ansible-roles/postgresql/tasks/pgdg-repo.yml
Benoît S. 771c75c1de
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/pr Build is passing
all-roles: Dot not use ansible_lsb as it is deprecated
We move from `ansible_lsb.codename` to `ansible_distribution_release`.
2019-07-03 09:41:35 +02:00

26 lines
705 B
YAML

---
- name: Open firewall for PGDG repository
replace:
name: /etc/default/minifirewall
regexp: "^(HTTPSITES='((?!apt\\.postgresql\\.org).)*)'$"
replace: "\\1 apt.postgresql.org'"
notify: Restart minifirewall
- meta: flush_handlers
- name: Add PGDG repository
apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main"
update_cache: yes
- name: Add GPG key for PGDG repository
apt_key:
#url: http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc
data: "{{ lookup('file', 'ACCC4CF8.asc') }}"
- name: Add APT preference file
template:
src: postgresql.pref.j2
dest: /etc/apt/preferences.d/
mode: "0644"