From 60c44d97e481bcd10badee1f91786373db90a586 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 18 May 2022 00:27:32 +0200 Subject: [PATCH] Add scripts for firefox --- localhost.yml | 1 + .../etc/apt/preferences.d/mozillateamppa | 3 +++ roles/firefox/tasks/main.yml | 6 +++++ roles/firefox/tasks/ppa.yml | 23 +++++++++++++++++++ roles/firefox/tasks/upstream.yml | 12 ++++++++++ roles/ubuntu/tasks/packages.yml | 7 ------ 6 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 roles/firefox/files/etc/apt/preferences.d/mozillateamppa create mode 100644 roles/firefox/tasks/main.yml create mode 100644 roles/firefox/tasks/ppa.yml create mode 100644 roles/firefox/tasks/upstream.yml diff --git a/localhost.yml b/localhost.yml index e10e680..78d8035 100644 --- a/localhost.yml +++ b/localhost.yml @@ -3,6 +3,7 @@ roles: - dwm - ubuntu + - firefox - docker - java - jetbrains diff --git a/roles/firefox/files/etc/apt/preferences.d/mozillateamppa b/roles/firefox/files/etc/apt/preferences.d/mozillateamppa new file mode 100644 index 0000000..6c871df --- /dev/null +++ b/roles/firefox/files/etc/apt/preferences.d/mozillateamppa @@ -0,0 +1,3 @@ +Package: firefox* +Pin: release o=LP-PPA-mozillateam +Pin-Priority: 501 \ No newline at end of file diff --git a/roles/firefox/tasks/main.yml b/roles/firefox/tasks/main.yml new file mode 100644 index 0000000..50b9808 --- /dev/null +++ b/roles/firefox/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- import_tasks: upstream.yml + when: ansible_distribution == "Ubuntu" and ansible_distribution_version != "22.04" + +- import_tasks: ppa.yml + when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "22.04" \ No newline at end of file diff --git a/roles/firefox/tasks/ppa.yml b/roles/firefox/tasks/ppa.yml new file mode 100644 index 0000000..9920319 --- /dev/null +++ b/roles/firefox/tasks/ppa.yml @@ -0,0 +1,23 @@ +- become: yes + block: + - name: remove snap + community.general.snap: + name: firefox + state: absent + + - name: add ppa + apt_repository: + repo: ppa:mozillateam/ppa + + - name: set mozillateam higher priority + copy: + src: etc/apt/preferences.d/mozillateamppa + dest: /etc/apt/preferences.d/mozillateamppa + + - name: install browser + become: yes + apt: + update_cache: yes + state: latest + pkg: + - firefox \ No newline at end of file diff --git a/roles/firefox/tasks/upstream.yml b/roles/firefox/tasks/upstream.yml new file mode 100644 index 0000000..50876f2 --- /dev/null +++ b/roles/firefox/tasks/upstream.yml @@ -0,0 +1,12 @@ +- name: remove snap + become: yes + community.general.snap: + name: firefox + state: absent + +- name: install browser + become: yes + apt: + update_cache: yes + pkg: + - firefox \ No newline at end of file diff --git a/roles/ubuntu/tasks/packages.yml b/roles/ubuntu/tasks/packages.yml index fc92b96..f0ba788 100644 --- a/roles/ubuntu/tasks/packages.yml +++ b/roles/ubuntu/tasks/packages.yml @@ -36,13 +36,6 @@ pkg: - git -- name: install browser - become: yes - apt: - update_cache: yes - pkg: - - firefox - - name: install gui apps become: yes apt: