From 0a079ae34a962b854a71d01103a93d82335f3f2a Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Thu, 6 Mar 2025 13:45:34 +0100 Subject: [PATCH] refactor: add Ansible tasks for Firefox PWA installation and integration --- .../ansible/tasks/workstations/firefoxpwa.yml | 51 +++++++++++++++++++ .../tasks/workstations/workstation.yml | 3 ++ 2 files changed, 54 insertions(+) create mode 100644 config/ansible/tasks/workstations/firefoxpwa.yml diff --git a/config/ansible/tasks/workstations/firefoxpwa.yml b/config/ansible/tasks/workstations/firefoxpwa.yml new file mode 100644 index 0000000..0126f19 --- /dev/null +++ b/config/ansible/tasks/workstations/firefoxpwa.yml @@ -0,0 +1,51 @@ +--- +- name: Install required packages for FirefoxPWA + ansible.builtin.apt: + name: + - curl + - gpg + - apt-transport-https + - debian-archive-keyring + state: present + update_cache: true + become: true + +- name: Download FirefoxPWA GPG key + ansible.builtin.get_url: + url: https://packagecloud.io/filips/FirefoxPWA/gpgkey + dest: /usr/share/keyrings/firefoxpwa-keyring.gpg + mode: '0644' + become: true + +- name: Import FirefoxPWA GPG key + ansible.builtin.command: + cmd: "set -o pipefail && gpg --dearmor < /usr/share/keyrings/firefoxpwa-keyring.gpg | tee /usr/share/keyrings/firefoxpwa-keyring.gpg > /dev/null" + args: + creates: /usr/share/keyrings/firefoxpwa-keyring.gpg + become: true + +- name: Add FirefoxPWA repository + ansible.builtin.copy: + content: "deb [signed-by=/usr/share/keyrings/firefoxpwa-keyring.gpg] https://packagecloud.io/filips/FirefoxPWA/any any main" + dest: /etc/apt/sources.list.d/firefoxpwa.list + mode: '0644' + become: true + +- name: Update apt cache + ansible.builtin.apt: + update_cache: true + become: true + +- name: Install FirefoxPWA package + ansible.builtin.apt: + name: firefoxpwa + state: present + become: true + +- name: Ensure FirefoxPWA integration is enabled for compatible browsers + ansible.builtin.command: + cmd: "firefoxpwa install --global" + register: pwa_integration + changed_when: "'Integration installed' in pwa_integration.stdout" + failed_when: false + become: true diff --git a/config/ansible/tasks/workstations/workstation.yml b/config/ansible/tasks/workstations/workstation.yml index 2a6914c..f89bb0c 100644 --- a/config/ansible/tasks/workstations/workstation.yml +++ b/config/ansible/tasks/workstations/workstation.yml @@ -20,6 +20,9 @@ - name: Include 1Password Zen Browser tasks ansible.builtin.import_tasks: tasks/workstations/1password-zen-browser.yml +- name: Include Firefox PWA tasks + ansible.builtin.import_tasks: tasks/workstations/firefoxpwa.yml + - name: Include Ulauncher tasks ansible.builtin.import_tasks: tasks/workstations/ulauncher.yml