From 98cb78d7afc9a0db7fb3117ed6dad8c9fb6a7c3b Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 14 Jul 2022 19:48:44 +0200 Subject: [PATCH] Fix firefox ppa for ubuntu --- roles/firefox/tasks/ppa.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/roles/firefox/tasks/ppa.yml b/roles/firefox/tasks/ppa.yml index 883edf7..2913847 100644 --- a/roles/firefox/tasks/ppa.yml +++ b/roles/firefox/tasks/ppa.yml @@ -1,17 +1,25 @@ - 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: ansible_facts.packages.firefox[0].version == "1.1snap1-0ubuntu2" + when: + - "'firefox' in ansible_facts.packages" + - ansible_facts.packages['firefox'].version == "1:1snap1-0ubuntu2" - name: remove apt snap wrapper version apt: state: absent pkg: - firefox - when: ansible_facts.packages.firefox[0].version == "1.1snap1-0ubuntu2" + when: + - "'firefox' in ansible_facts.packages" + - ansible_facts.packages['firefox'].version == "1:1snap1-0ubuntu2" - name: add ppa apt_repository: @@ -28,4 +36,4 @@ update_cache: yes state: latest pkg: - - firefox \ No newline at end of file + - firefox