2020-09-06 18:50:02 +00:00
|
|
|
---
|
2023-10-31 19:10:51 +00:00
|
|
|
- name: Variable configuration.
|
|
|
|
include_tasks: variables.yml
|
2020-09-06 18:50:02 +00:00
|
|
|
|
2023-10-31 19:10:51 +00:00
|
|
|
- name: Setup/install tasks.
|
|
|
|
include_tasks: setup-RedHat.yml
|
2020-09-06 18:50:02 +00:00
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
- include_tasks: setup-Debian.yml
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- include_tasks: setup-Arch.yml
|
|
|
|
when: ansible_os_family == 'Archlinux'
|
|
|
|
|
|
|
|
- include_tasks: initialize.yml
|
|
|
|
- include_tasks: configure.yml
|
2024-05-08 19:11:39 +00:00
|
|
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
2020-09-06 18:50:02 +00:00
|
|
|
- name: Ensure PostgreSQL is started and enabled on boot.
|
|
|
|
service:
|
|
|
|
name: "{{ postgresql_daemon }}"
|
|
|
|
state: "{{ postgresql_service_state }}"
|
|
|
|
enabled: "{{ postgresql_service_enabled }}"
|
2024-05-08 19:11:39 +00:00
|
|
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
2020-09-06 18:50:02 +00:00
|
|
|
|
|
|
|
# Configure PostgreSQL.
|
|
|
|
- import_tasks: users.yml
|
2024-05-08 19:11:39 +00:00
|
|
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
2020-09-06 18:50:02 +00:00
|
|
|
- import_tasks: databases.yml
|
2024-05-08 19:11:39 +00:00
|
|
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
2023-10-31 19:11:28 +00:00
|
|
|
- name: Import Consul service task
|
|
|
|
ansible.builtin.import_tasks: consul.yml
|
|
|
|
when: postgres_consul_service
|