From db6390220679a5f797688bc3d7609e07425d8445 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 11 Dec 2023 14:04:55 +0100 Subject: [PATCH] apt: use the GPG version of the key for Debian 8-9 --- CHANGELOG.md | 1 + apt/tasks/evolix_public.deb822.yml | 8 +++++++- apt/tasks/evolix_public.oneline.yml | 20 ++++++++++++++++++-- apt/templates/evolix_public.list.j2 | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e97ab46e..ec472e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The **patch** part changes is incremented if multiple releases happen the same m * add-vm.sh: allow VM name max length > 20 * apache : fix goaway pattern for bad bots * apache : rename MaxRequestsPerChild to MaxConnectionsPerChild (new name) +* apt: use the GPG version of the key for Debian 8-9 * bind: Update role for Buster, Bullseye and Bookworm support * dovecot: Munin plugin conf path is now `/etc/munin/plugin-conf.d/zzz-dovecot` (instead of `z-evolinux-dovecot`) * evocheck: upstream release 23.11.1 diff --git a/apt/tasks/evolix_public.deb822.yml b/apt/tasks/evolix_public.deb822.yml index 0a91dddf..0e6639c3 100644 --- a/apt/tasks/evolix_public.deb822.yml +++ b/apt/tasks/evolix_public.deb822.yml @@ -24,10 +24,16 @@ owner: root group: root +- name: Set Evolix GPG key format to ASC + set_fact: + apt_evolix_public_key: "{{ apt_keyring_dir }}/pub_evolix.asc" + tags: + - apt + - name: Add Evolix GPG key ansible.builtin.copy: src: pub_evolix.asc - dest: "{{ apt_keyring_dir }}/pub_evolix.asc" + dest: "{{ apt_evolix_public_key }}" force: true mode: "0644" owner: root diff --git a/apt/tasks/evolix_public.oneline.yml b/apt/tasks/evolix_public.oneline.yml index 9501e595..165a7b93 100644 --- a/apt/tasks/evolix_public.oneline.yml +++ b/apt/tasks/evolix_public.oneline.yml @@ -24,10 +24,26 @@ owner: root group: root +- name: Set Evolix GPG key format to GPG (Debian < 9) + set_fact: + apt_evolix_public_key: "pub_evolix.gpg" + when: + - ansible_distribution_major_version is version('9', '<') + tags: + - apt + +- name: Set Evolix GPG key format to ASC (Debian >= 9) + set_fact: + apt_evolix_public_key: "pub_evolix.asc" + when: + - ansible_distribution_major_version is version('9', '>=') + tags: + - apt + - name: Add Evolix GPG key ansible.builtin.copy: - src: pub_evolix.asc - dest: "{{ apt_keyring_dir }}/pub_evolix.asc" + src: "{{ apt_evolix_public_key }}" + dest: "{{ apt_keyring_dir }}/{{ apt_evolix_public_key }}" force: true mode: "0644" owner: root diff --git a/apt/templates/evolix_public.list.j2 b/apt/templates/evolix_public.list.j2 index e00899e7..7ed18708 100644 --- a/apt/templates/evolix_public.list.j2 +++ b/apt/templates/evolix_public.list.j2 @@ -1,3 +1,3 @@ # {{ ansible_managed }} -deb [signed-by={{ apt_keyring_dir }}/pub_evolix.asc] http://pub.evolix.org/evolix {{ ansible_distribution_release }} main +deb [signed-by={{ apt_keyring_dir }}/{{ apt_evolix_public_key }}] http://pub.evolix.org/evolix {{ ansible_distribution_release }} main