ansible-role-ntfy/tasks/Debian.yml

26 lines
786 B
YAML
Raw Permalink Normal View History

---
# https://www.jeffgeerling.com/blog/2022/aptkey-deprecated-debianubuntu-how-fix-ansible
- name: Add ntfy apt repository key.
ansible.builtin.get_url:
url: "{{ ntfy_repo_key_url }}"
dest: /usr/share/keyrings/archive.heckel.io.asc
mode: '0644'
# force: true
- name: Ensure the repository is added with the relevant trusted GPG key
ansible.builtin.lineinfile:
path: /etc/apt/sources.list.d/ntfy.list
line: deb [arch=amd64 signed-by=/usr/share/keyrings/archive.heckel.io.asc] https://archive.heckel.io/apt debian main
create: true
register: ntfy_repo
- name: Update the apt repository cache
ansible.builtin.apt:
update_cache: yes
when: ntfy_repo.changed
- name: Install the ntfy package
ansible.builtin.apt:
name: ntfy
state: latest