62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
---
|
|
- name: Distribution
|
|
debug:
|
|
msg: "{{ ansible_distribution }}"
|
|
|
|
- name: Distribution version
|
|
debug:
|
|
msg: "{{ ansible_distribution_version}}"
|
|
|
|
- name: Distribution major version
|
|
debug:
|
|
msg: "{{ ansible_distribution_major_version }}"
|
|
|
|
- name: postgres | install | postgres pre-install show shared_preload_libraries list
|
|
debug:
|
|
msg: "{{ pg_config_shared_preload_libraries + ['timescaledb'] }}"
|
|
|
|
- name: postgres | install | timescale pre-install
|
|
set_fact:
|
|
pg_config_shared_preload_libraries: "{{ pg_config_shared_preload_libraries + ['timescaledb'] }}"
|
|
when: '"timescale" in additional_extension'
|
|
|
|
- name: postgres | install | postgres pre-install show shared_preload_libraries list
|
|
debug:
|
|
msg: "{{ pg_config_shared_preload_libraries }}"
|
|
|
|
- name: postgres | install | install postgres repo
|
|
dnf:
|
|
name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
|
|
state: present
|
|
disable_gpg_check: yes
|
|
|
|
- name: postgres | install | list postgresql
|
|
ansible.builtin.command: dnf -qy module list postgresql
|
|
register: postgresql_list_repo
|
|
ignore_errors: yes
|
|
|
|
- name: postgres | install | disable postgresql module
|
|
ansible.builtin.command: dnf -qy module disable postgresql
|
|
register: postgresql_disable_repo
|
|
args:
|
|
creates: /etc/dnf/modules.d/postgresql.module
|
|
when: postgresql_list_repo.rc == 0
|
|
|
|
- name: postgres | install | install postgresql
|
|
dnf:
|
|
name:
|
|
- postgresql{{postgres_version}}
|
|
- postgresql{{postgres_version}}-server
|
|
- postgresql{{postgres_version}}-contrib.x86_64
|
|
state: present
|
|
|
|
- name: postgres | install | epel-release
|
|
dnf:
|
|
name: epel-release
|
|
state: present
|
|
|
|
- name: postgres | install | install custom extension
|
|
include_tasks: "tasks/extension/{{ item }}.yaml"
|
|
with_items: "{{ additional_extension }}"
|
|
# when: additional_extension
|