Skip to content

Commit

Permalink
resolve issue with apt-key deprecation and postgres repo (#336)
Browse files Browse the repository at this point in the history
* resolve issue with apt-key deprecation and postgres repo

seems that this boiled down to the format of the gpg key file.

configuring with .asc (plaintext) instead of .gpg (binary) per the documentation
at https://wiki.postgresql.org/wiki/Apt resolved the issue.

* lint

* simpler
  • Loading branch information
ewdurbin committed Jan 16, 2024
1 parent 79c4218 commit e93bdf1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions salt/postgresql/base/init.sls
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{% if grains["oscodename"] == "jammy" %}
postgresql-key:
file.managed:
- name: /etc/apt/keyrings/postgresql.asc
- mode: "0644"
- source: salt://postgresql/base/APT-GPG-KEY-POSTGRESQL

postgresql-repo:
pkgrepo.managed:
- name: "deb http://apt.postgresql.org/pub/repos/apt {{ grains['oscodename'] }}-pgdg main"
- name: "deb [signed-by=/etc/apt/keyrings/postgresql.asc arch={{ grains["osarch"] }}] https://apt.postgresql.org/pub/repos/apt {{ grains['oscodename'] }}-pgdg main"
- aptkey: False
- require:
- file: postgresql-key
- file: /etc/apt/sources.list.d/postgresql.list
{% else %}
postgresql-repo:
pkgrepo.managed:
- name: "deb http://apt.postgresql.org/pub/repos/apt {{ grains['oscodename'] }}-pgdg main"
- key_url: salt://postgresql/base/APT-GPG-KEY-POSTGRESQL
- order: 2
- file: /etc/apt/sources.list.d/postgresql.list
{% endif %}

0 comments on commit e93bdf1

Please sign in to comment.