ndon't initialize and configure standby database
This commit is contained in:
parent
2d1ae51136
commit
25c7779d91
@ -21,7 +21,8 @@
|
|||||||
|
|
||||||
- name: Ensure PostgreSQL database is initialized.
|
- name: Ensure PostgreSQL database is initialized.
|
||||||
command: "{{ postgresql_bin_path }}/initdb -D {{ postgresql_data_dir }} --locale=C.UTF-8 --encoding=UTF8 --data-checksums"
|
command: "{{ postgresql_bin_path }}/initdb -D {{ postgresql_data_dir }} --locale=C.UTF-8 --encoding=UTF8 --data-checksums"
|
||||||
when: not pgdata_dir_version.stat.exists
|
when: not pgdata_dir_version.stat.exists and (postgres_consul_tag is not defined or postgres_consul_tag == "active")
|
||||||
|
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ postgresql_user }}"
|
become_user: "{{ postgresql_user }}"
|
||||||
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
|
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
|
||||||
|
@ -14,17 +14,19 @@
|
|||||||
|
|
||||||
- include_tasks: initialize.yml
|
- include_tasks: initialize.yml
|
||||||
- include_tasks: configure.yml
|
- include_tasks: configure.yml
|
||||||
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
||||||
- name: Ensure PostgreSQL is started and enabled on boot.
|
- name: Ensure PostgreSQL is started and enabled on boot.
|
||||||
service:
|
service:
|
||||||
name: "{{ postgresql_daemon }}"
|
name: "{{ postgresql_daemon }}"
|
||||||
state: "{{ postgresql_service_state }}"
|
state: "{{ postgresql_service_state }}"
|
||||||
enabled: "{{ postgresql_service_enabled }}"
|
enabled: "{{ postgresql_service_enabled }}"
|
||||||
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
||||||
|
|
||||||
# Configure PostgreSQL.
|
# Configure PostgreSQL.
|
||||||
- import_tasks: users.yml
|
- import_tasks: users.yml
|
||||||
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
||||||
- import_tasks: databases.yml
|
- import_tasks: databases.yml
|
||||||
|
when: postgres_consul_tag is not defined or postgres_consul_tag == "active"
|
||||||
- name: Import Consul service task
|
- name: Import Consul service task
|
||||||
ansible.builtin.import_tasks: consul.yml
|
ansible.builtin.import_tasks: consul.yml
|
||||||
when: postgres_consul_service
|
when: postgres_consul_service
|
||||||
|
Loading…
Reference in New Issue
Block a user