forked from gdcc/dataverse-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgres_redhat.yml
More file actions
38 lines (32 loc) · 1.12 KB
/
postgres_redhat.yml
File metadata and controls
38 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: import PGDG-RPM-GPG-KEY-RHEL
ansible.builtin.rpm_key:
state: present
key: https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL
become: yes
- name: install postgres repo RPM
ansible.builtin.yum:
name: 'https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}/pgdg-redhat-repo-latest.noarch.rpm'
state: present
disable_gpg_check: true
become: yes
- name: "RHEL/Rocky: disable PostgreSQL proper in the OS"
shell: |
dnf -qy module disable postgresql
args:
executable: /bin/bash
ignore_errors: yes
become: yes
- name: get postgres config directory
set_fact:
postgres_config_dir: '/var/lib/pgsql/{{ db.postgres.version }}/data'
- name: install postgres server on RedHat / Rocky
ansible.builtin.package:
name: 'postgresql{{ dataverse_pg_version_short }}-server'
state: latest
when: db.use_rds == false
- name: install postgres client on RedHat / Rocky for RDS
ansible.builtin.package:
name: 'postgresql{{ dataverse_pg_version_short }}'
state: latest
when: db.use_rds == true