You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

10 months ago
---
- name: Set up firefox
hosts: localhost
vars:
uid: "{{ lookup('env','USER') }}"
host_app_url: https://github.com/passff/passff-host/releases/latest/download/install_host_app.sh
10 months ago
key_path: /usr/share/keyrings/firefox.gpg
key_url: http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xc77205f7194a3e1abe2df9a4b7b9c16f2667ca5c
10 months ago
connection: local
become: false
tasks:
- name: Have key allready installed
stat:
path: '{{key_path}}'
register: key
- name: Get key
ansible.builtin.command:
chdir: /tmp
10 months ago
cmd: wget -O ./keyring.gpg '{{ key_url }}'
10 months ago
creates: /tmp/keyring.gpg
when: not key.stat.exists
- name: Dearmor key
ansible.builtin.command:
chdir: /tmp
cmd: gpg --dearmor -o {{ key_path }} ./keyring.gpg
creates: '{{key_path}}'
become: true
when: not key.stat.exists
- name: install repo
become: true
ansible.builtin.template:
10 months ago
src: ../templates/firefox.sources.j2
dest: /etc/apt/sources.list.d/firefox.sources
10 months ago
when: not key.stat.exists
- name: Install apt package
become: true
ansible.builtin.apt:
autoclean: true
autoremove: true
install_recommends: true
10 months ago
pkg: [firefox-mozilla-build]
10 months ago
state: latest
update_cache: true
- name: Get host app
ansible.builtin.command:
chdir: /tmp
cmd: wget {{ host_app_url }}
creates: /tmp/install_host_app.sh
when: not key.stat.exists
- name: Install host app
ansible.builtin.command:
10 months ago
cmd: bash /tmp/install_host_app.sh firefox
10 months ago
when: not key.stat.exists
- name: Clean up
ansible.builtin.command:
chdir: /tmp
cmd: rm ./install_host_app.sh ./keyring.gpg
removes: [/tmp/install_host_app.sh, /tmp/keyring.gpg]
when: not key.stat.exists