Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PostgreSQL apt repo and signing key for installing specific versions of Postgres for debian based distros #251

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
21 changes: 21 additions & 0 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
---
- name: Check if signing key is present
stat:
path: /etc/apt/trusted.gpg.d/pgdg.asc
register: postgresql_st_pgdg

- name: Import and Write gpg key to pgdg.asc
get_url:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
dest: /etc/apt/trusted.gpg.d/pgdg.asc
become: true
when: not postgresql_st_pgdg.stat.exists

- name: Add postgresql repository into sources list
ansible.builtin.apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main"
state: present

- name: Update cache
apt: update_cache=yes state=latest
become: true

- name: Ensure PostgreSQL Python libraries are installed.
apt:
name: "{{ postgresql_python_library }}"
Expand Down
Loading