home · contact · privacy
fdd4af284a83fc5448f361d614ebf16cdc69c6b3
[config] / ansible / tasks / qutebrowser.yml
1 ---
2
3 - name: Set qutebrowser, python3-pypeg2 facts.
4   set_fact:
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
9
10
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
16
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
23
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
27
28 - name: Download qutebrowser package.
29   get_url: url={{ qutebrowser_deb_url }} dest={{ qutebrowser_deb_path }}
30   when: qutebrowser_debcheck.rc == 1
31
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
37
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
41
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