mastodon: replace deprecated apt_key with keyring files

apt_key is deprecated as well; the yarn and nodejs keys are already
downloaded as keyring files and referenced via signed_by. Drop the
redundant apt_key task, give yarn a signed_by too, normalize the keyring
filenames to the *-archive-keyring.gpg convention, and clean up the old
keyring files.
This commit is contained in:
rene committed 2026-10-22 19:24:53 +02:00
1 parent 74140629f3
commit 83e6accdc1
1 file changed
+13 -12
@@ -5,22 +5,14 @@
- apt-transport-https
state: present
- name: mastodon | package manager | add gpg keys
apt_key:
id: "{{ item.id }}"
url: "{{ item.url }}"
state: present
loop:
- { id: "72ECF46A56B4AD39C907BBB71646B01B86E50310", url: "https://dl.yarnpkg.com/debian/pubkey.gpg" }
- { id: "9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280", url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" }
- name: mastodon | package manager | download gpg keys
get_url:
url: "{{ item.url }}"
dest: "/usr/share/keyrings/{{ item.localkey }}"
mode: "0644"
loop:
- { url: "https://dl.yarnpkg.com/debian/pubkey.gpg", localkey: "yarnkey.gpg" }
- { url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key", localkey: "nodesource.gpg.key" }
- { url: "https://dl.yarnpkg.com/debian/pubkey.gpg", localkey: "yarn-archive-keyring.gpg" }
- { url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key", localkey: "nodesource-archive-keyring.gpg" }
- name: mastodon | package manager | remove legacy repository files
file:
@@ -38,6 +30,7 @@
suites: stable
components:
- main
signed_by: /usr/share/keyrings/yarn-archive-keyring.gpg
mode: "0644"
- name: mastodon | package manager | add nodejs repository
@@ -50,8 +43,16 @@
suites: "{{ ansible_facts['distribution_release'] }}"
components:
- main
signed_by: /usr/share/keyrings/nodesource.gpg.key
signed_by: /usr/share/keyrings/nodesource-archive-keyring.gpg
mode: "0644"
- name: mastodon | package manager | remove legacy keyring files
file:
path: "/usr/share/keyrings/{{ item }}"
state: absent
loop:
- yarnkey.gpg
- nodesource.gpg.key
- name: mastodon | package manager | update cache
apt: update_cache=yes