postgresql/tasks/RedHat/main.yaml
2023-02-08 02:13:12 +03:00

36 lines
991 B
YAML

- name: Disable PostgreSQL module
shell: dnf module disable -y postgresql
register: disable_postgresql_module
changed_when: "'Nothing to do' not in disable_postgresql_module.stdout"
- name: Add PostgreSQL repository
dnf:
name: "{{ postgresql_repo_package }}"
disable_gpg_check: yes
state: present
- name: "Install {{ postgresql_package_name }} {{ postgresql_version }}"
dnf:
name: "{{ postgresql_package }}"
state: present
disable_gpg_check: yes
register: postgresql_setup
- name: Manage TLS/SSL certificates
include_tasks: cacert.yaml
when: postgresql_ssl
- name: PostgreSQL Initdb
shell: "/usr/pgsql-{{ postgresql_major_version }}/bin/postgresql-{{ postgresql_major_version }}-setup initdb"
register: initdb
changed_when: "'Data directory is not empty!' not in initdb.stdout"
failed_when: false
- name: Include WAL-G role
ansible.builtin.include_role:
name: wal-g
vars:
wal_g_pg: yes
when: postgresql_wal_g_install