ansible/tasks/powerdns-bullseye/gpg-key.yml

20 lines
692 B
YAML

---
- name: Check if PowerDNS GPG key is already present
ansible.builtin.stat:
path: /etc/apt/trusted.gpg.d/pdns.gpg
register: pdns_gpg_presence
- name: Download armored PowerDNS GPG key
ansible.builtin.get_url:
url: https://repo.powerdns.com/FD380FBB-pub.asc
dest: /tmp/pdns.asc
when: not pdns_gpg_presence.stat.exists
- name: Ensure unarmored PowerDNS GPG key is present
ansible.builtin.command:
cmd: gpg --dearmor -o /etc/apt/trusted.gpg.d/pdns.gpg /tmp/pdns.asc
when: not pdns_gpg_presence.stat.exists
- name: Remove temporary armored PowerDNS GPG key
ansible.builtin.file:
path: /tmp/pdns.asc
state: absent
when: not pdns_gpg_presence.stat.exists