3 - name: Set qutebrowser, python3-pypeg2 facts.
5 qutebrowser_deb_url: https://github.com/qutebrowser/qutebrowser/releases/download/v0.11.0/qutebrowser_0.11.0-1_all.deb
6 python3pypeg2_deb_url: https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb
7 qutebrowser_deb_path: /tmp/qutebrowser.deb
8 python3pypeg2_deb_path: /tmp/python3-pypeg2.deb
11 - name: Check if qutebrowser is installed.
12 command: dpkg-query -W qutebrowser
13 register: qutebrowser_debcheck
14 failed_when: qutebrowser_debcheck.rc > 1
15 changed_when: qutebrowser_debcheck.rc == 1
17 - name: Check if qutebrowser-dependency python3-pypeg2 is installed.
18 command: dpkg-query -W python3-pypeg2
19 register: python3pypeg2_debcheck
20 failed_when: python3pypeg2_debcheck.rc > 1
21 changed_when: python3pypeg2_debcheck.rc == 1
22 when: qutebrowser_debcheck.rc == 1
24 - name: Download python3-pypeg2 package.
25 get_url: url={{ python3pypeg2_deb_url }} dest={{ python3pypeg2_deb_path }}
26 when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
28 - name: Download qutebrowser package.
29 get_url: url={{ qutebrowser_deb_url }} dest={{ qutebrowser_deb_path }}
30 when: qutebrowser_debcheck.rc == 1
32 # We use command: apt as a workaround because the Ansible apt module installs
33 # the Depends of the .deb marked as manual while we want them marked as auto.
34 - name: Install python3-pypeg2 package,
35 command: apt install --yes "{{ python3pypeg2_deb_path}}"
36 when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
38 - name: Mark python3-pypeg2 package as automatically installed.
39 command: apt-mark auto python3-pypeg2
40 when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
42 # We use command: apt as a workaround because the Ansible apt module installs
43 # the Depends of the .deb marked as manual while we want them marked as auto.
44 - name: Install qutebrowser package.
45 command: apt install --yes "{{ qutebrowser_deb_path}}"
46 when: qutebrowser_debcheck.rc == 1