home · contact · privacy
Enhance w530 bookworm setup.
[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 - name: Check if qutebrowser is installed.
11   command: dpkg-query -W qutebrowser
12   register: qutebrowser_debcheck
13   failed_when: qutebrowser_debcheck.rc > 1
14   changed_when: qutebrowser_debcheck.rc == 1
15
16 - name: Check if qutebrowser-dependency python3-pypeg2 is installed.
17   command: dpkg-query -W python3-pypeg2 
18   register: python3pypeg2_debcheck
19   failed_when: python3pypeg2_debcheck.rc > 1
20   changed_when: python3pypeg2_debcheck.rc == 1
21   when: qutebrowser_debcheck.rc == 1
22
23 - name: Download python3-pypeg2 package.
24   get_url: url={{ python3pypeg2_deb_url }} dest={{ python3pypeg2_deb_path }}
25   when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
26
27 - name: Download qutebrowser package.
28   get_url: url={{ qutebrowser_deb_url }} dest={{ qutebrowser_deb_path }}
29   when: qutebrowser_debcheck.rc == 1
30
31 # We use command: apt as a workaround because the Ansible apt module installs
32 # the Depends of the .deb marked as manual while we want them marked as auto.
33 - name: Install python3-pypeg2 package,
34   command: apt install --yes "{{ python3pypeg2_deb_path}}"
35   when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
36
37 - name: Mark python3-pypeg2 package as automatically installed.
38   command: apt-mark auto python3-pypeg2
39   when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
40
41 # We use command: apt as a workaround because the Ansible apt module installs
42 # the Depends of the .deb marked as manual while we want them marked as auto.
43 - name: Install qutebrowser package.
44   command: apt install --yes "{{ qutebrowser_deb_path}}"
45   when: qutebrowser_debcheck.rc == 1