Start on postgresql role

This commit is contained in:
Sam A. 2023-11-12 17:59:18 +01:00
parent b8e18cdbe9
commit 6ef6b227cf
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
3 changed files with 30 additions and 1 deletions

View file

@ -1,4 +1,5 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
db_data_root: "{{ encrypted_fs }}/db"
postgresql_version: 14
postgresql_pgdata: "{{ encrypted_fs }}/pgsql/{{ postgresql_version }}/data"

View file

@ -0,0 +1,6 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
postgresql_version: 14
postgresql_pgdata: /var/lib/pgsql/{{ postgresql_version }}/data
postgresql_service: postgresql-{{ postgresql_version }}

View file

@ -0,0 +1,22 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Add PostgreSQL repository
ansible.builtin.dnf:
name: https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
state: present
- name: Disable built-in PostgreSQL module
community.general.ini_file:
path: /etc/dnf/modules.d/postgresql.module
section: postgresql
option: state
value: disabled
no_extra_spaces: true
create: false
state: present
- name: Install PostgreSQL {{ postgresql_version }}
ansible.builtin.dnf:
name: postgresql{{ postgresql_version }}-server
state: present