Start on postgresql role
This commit is contained in:
parent
b8e18cdbe9
commit
6ef6b227cf
|
@ -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"
|
||||
|
|
6
roles/postgresql/defaults/main.yml
Normal file
6
roles/postgresql/defaults/main.yml
Normal 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 }}
|
22
roles/postgresql/tasks/main.yml
Normal file
22
roles/postgresql/tasks/main.yml
Normal 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
|
Loading…
Reference in a new issue