diff --git a/roles/librewolf/files/librewolf.list b/roles/librewolf/files/librewolf.list new file mode 100644 index 0000000..f477367 --- /dev/null +++ b/roles/librewolf/files/librewolf.list @@ -0,0 +1 @@ +deb [arch=amd64] http://deb.librewolf.net $distro main diff --git a/roles/librewolf/handlers/main.yml b/roles/librewolf/handlers/main.yml new file mode 100644 index 0000000..7da1dff --- /dev/null +++ b/roles/librewolf/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Update apt cache + become: true + apt: + update_cache: true diff --git a/roles/librewolf/tasks/main.yml b/roles/librewolf/tasks/main.yml index 226ad54..9395626 100644 --- a/roles/librewolf/tasks/main.yml +++ b/roles/librewolf/tasks/main.yml @@ -1,31 +1,49 @@ --- -- name: Clone librewolf (Archlinux) - git: - repo: https://aur.archlinux.org/librewolf-bin.git - dest: ~/builds/librewolf-bin - clone: true - update: false - version: master +- name: Install librewolf (Archlinux) + block: + - name: Clone librewolf (Archlinux) + git: + repo: https://aur.archlinux.org/librewolf-bin.git + dest: ~/builds/librewolf-bin + clone: true + update: false + version: master + - name: Add gpg key for librewolf (Archlinux) + command: gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 031F7104E932F7BD7416E7F6D2845E1305D6E801 + register: result + changed_when: "'unchanged: 1' not in result.stderr" + - name: Make and install librewolf (Archlinux) + command: + cmd: makepkg -cirs --needed + chdir: ~/builds/librewolf-bin + stdin: Y + register: result + changed_when: "'installing existing package' not in result.stderr" when: ansible_facts['distribution'] == 'Archlinux' -- name: Add gpg key for librewolf - command: gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 031F7104E932F7BD7416E7F6D2845E1305D6E801 - when: ansible_facts['distribution'] == 'Archlinux' - -- name: Make and install librewolf (Archlinux) - command: - cmd: makepkg -cirs --needed - chdir: ~/builds/librewolf-bin - stdin: Y - when: ansible_facts['distribution'] == 'Archlinux' - register: result - changed_when: "'installing existing package' not in result.stderr" - - name: Install librewolf (Debian) - become: true - apt: - name: - - librewolf + block: + - name: Copy librewolf.list (Debian) + become: true + copy: + src: librewolf.list + dest: /etc/apt/sources.list.d/librewolf.list + mode: 0644 + notify: Update apt cache + - name: Add gpg key for librewolf (Debian) + become: true + get_url: + url: https://deb.librewolf.net/keyring.gpg + dest: /etc/apt/trusted.gpg.d/librewolf.gpg + mode: 0644 + notify: Update apt cache + - name: Flush handlers + meta: flush_handlers + - name: Install librewolf (Debian) + become: true + apt: + name: + - librewolf when: ansible_facts['distribution'] == 'Debian' - name: Open addon pages for installation