You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
696 B
YAML

- name: Install gnupg
apt:
pkg: gnupg
- name: Install key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
state: present
- name: Add postgresql repository into sources list as pgdg file
ansible.builtin.apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main"
state: present
filename: pgdg
- name: Install postgre
apt:
pkg: postgresql-15*
register: postgre_installation
- name: Delete old configuration
shell: rm -rf /var/lib/postgresql/*
when: postgre_installation.changed
- name: Init PostgreSQL
shell: pg_createcluster 15 main --start
when: postgre_installation.changed