File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 11---
2- # tasks/main.yml - Install Firefox from Mozilla APT repository
3-
4- - name : Setup Mozilla Firefox repository
5- block :
2+ # https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions-recommended
3+ - block :
64 - name : Ensure APT keyrings directory exists
75 ansible.builtin.file :
86 path : /etc/apt/keyrings
4038 update_cache : true
4139 cache_valid_time : 3600
4240
41+ - name : Check if Firefox is installed and from Mozilla repository
42+ ansible.builtin.shell : |
43+ if dpkg -l firefox 2>/dev/null | grep -q '^ii'; then
44+ apt-cache policy firefox | grep -q 'packages.mozilla.org' && echo "mozilla" || echo "other"
45+ else
46+ echo "not_installed"
47+ fi
48+ register : firefox_source
49+ changed_when : false
50+
4351 - name : Remove Firefox snap stub package
4452 ansible.builtin.apt :
4553 name : firefox
4654 state : absent
4755 purge : true
56+ when : firefox_source.stdout in ['other', 'not_installed']
4857
49- - name : Install Firefox
58+ - name : Install Firefox from Mozilla repository
5059 ansible.builtin.apt :
5160 name : firefox
5261 state : present
62+ when : firefox_source.stdout != 'mozilla'
5363 tags : ['firefox']
You can’t perform that action at this time.
0 commit comments