From 34b77d4bbaf12a67a24f943a802a4257a3e4289c Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Sun, 17 Nov 2024 01:44:42 +0100 Subject: [PATCH] Deploy GPG keys to fixed location Fixes #1 --- tasks/install_el.yml | 1 + tasks/install_ubuntu.yml | 1 + templates/pgdg.list.j2 | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/install_el.yml b/tasks/install_el.yml index 3e47d3b..12d33bd 100644 --- a/tasks/install_el.yml +++ b/tasks/install_el.yml @@ -5,4 +5,5 @@ name: PostgreSQL package: postgresql17-server gpg_file: PGDG-RPM-GPG-KEY + gpg_dest: /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY repo_file: "pgdg-{% if ansible_distribution == 'Fedora' %}fedora{% else %}redhat{{ ansible_distribution_major_version }}{% endif %}" diff --git a/tasks/install_ubuntu.yml b/tasks/install_ubuntu.yml index 781bd3b..44426bf 100644 --- a/tasks/install_ubuntu.yml +++ b/tasks/install_ubuntu.yml @@ -5,4 +5,5 @@ name: PostgreSQL package: postgresql-17 gpg_url: https://www.postgresql.org/media/keys/ACCC4CF8.asc + gpg_dest: /etc/apt/trusted.gpg.d/apt.postgresql.org.asc repo_file: pgdg diff --git a/templates/pgdg.list.j2 b/templates/pgdg.list.j2 index fb9746a..7e83c8a 100644 --- a/templates/pgdg.list.j2 +++ b/templates/pgdg.list.j2 @@ -1,2 +1 @@ -#deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main -deb https://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main +deb [signed-by=/etc/apt/trusted.gpg.d/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main