- become: yes block: - name: Gather the package facts ansible.builtin.package_facts: manager: auto - name: remove snap community.general.snap: name: firefox state: absent when: - "'snapd' in ansible_facts.packages" - "'firefox' in ansible_facts.packages" - ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2" - name: remove snap community.general.snap: name: firefox state: disabled when: - "'snapd' in ansible_facts.packages" - "'firefox' in ansible_facts.packages" - ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2" - name: remove apt snap wrapper version apt: state: absent pkg: - firefox when: - "'firefox' in ansible_facts.packages" - ansible_facts.packages['firefox'][0].version == "1:1snap1-0ubuntu2" - name: Add linux mint source list ansible.builtin.apt_repository: repo: deb http://packages.linuxmint.com vera upstream state: present - name: set linux mint for higher priority copy: src: etc/apt/preferences.d/mint-firefox dest: /etc/apt/preferences.d/mint-firefox - name: Remove unattended upgrades file: path: /etc/apt/apt.conf.d/51unattended-upgrades-firefox state: absent - name: Remove mozilla ppa apt_repository: repo: ppa:mozillateam/ppa state: absent - name: install equivs apt: update_cache: yes state: latest pkg: - equivs - name: copy fakepackage to satisfy dependencies copy: src: tmp/fakepkg dest: /tmp/fakepkg - name: make fake ubuntu-system-adjustments package shell: cmd: equivs-build /tmp/fakepkg chdir: /tmp - name: Install a .deb package ansible.builtin.apt: deb: /tmp/ubuntu-system-adjustments_2021.12.16_all.deb - name: install browser apt: allow_downgrade: true update_cache: yes state: latest pkg: - firefox - name: Set firefox as x-www-browser command: update-alternatives --set x-www-browser /usr/bin/firefox - name: update xdg default-web-browser command: xdg-settings set default-web-browser firefox.desktop