File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 534534 group : postgres
535535 mode : " 0640"
536536
537+ - name : Prepare PostgreSQL | validate generated pg_hba.conf
538+ become : true
539+ become_user : postgres
540+ community.postgresql.postgresql_query :
541+ login_host : " 127.0.0.1"
542+ login_port : " {{ postgresql_port }}"
543+ login_user : " {{ patroni_superuser_username }}"
544+ login_password : " {{ patroni_superuser_password }}"
545+ login_db : " postgres"
546+ query : " SELECT * FROM pg_hba_file_rules WHERE error IS NOT NULL"
547+ register : pg_hba_validate_result
548+ failed_when : pg_hba_validate_result.query_result | length > 0
549+
537550 - name : Prepare PostgreSQL | reload for apply the pg_hba.conf
538551 become : true
539552 become_user : postgres
927940 (('replica' in groups and groups['replica'] | length > 0 and inventory_hostname in groups['replica'] and postgresql_conf_dir != postgresql_data_dir)
928941 or postgresql_exists | default(false) | bool)
929942
943+ - name : Prepare PostgreSQL | validate generated pg_hba.conf
944+ become : true
945+ become_user : postgres
946+ community.postgresql.postgresql_query :
947+ login_host : " 127.0.0.1"
948+ login_port : " {{ postgresql_port }}"
949+ login_user : " {{ patroni_superuser_username }}"
950+ login_password : " {{ patroni_superuser_password }}"
951+ login_db : " postgres"
952+ query : " SELECT * FROM pg_hba_file_rules WHERE error IS NOT NULL"
953+ register : pg_hba_validate_result
954+ failed_when : pg_hba_validate_result.query_result | length > 0
955+ when : inventory_hostname == groups['master'][0]
956+
930957 - name : Prepare PostgreSQL | reload for apply the pg_hba.conf
931958 become : true
932959 become_user : postgres
Original file line number Diff line number Diff line change 33 ansible.builtin.template :
44 src : templates/patroni.yml.j2
55 dest : " {{ patroni_config_file | default('/etc/patroni/patroni.yml') }}"
6+ validate : patroni --validate-config %s
67 owner : postgres
78 group : postgres
89 mode : " 0640"
Original file line number Diff line number Diff line change 6969{% if dcs_type == 'consul' %}
7070consul:
7171 host: 127.0.0.1:8500
72- checks: []
7372 {% if consul_tls_enable | default (false ) | bool %}
7473 scheme: https
7574 cacert: {{ patroni_consul_cacert | default('/etc/patroni/tls/consul/ca.crt') }}
Original file line number Diff line number Diff line change 66 name : " {{ item.schema }}"
77 owner : " {{ item.owner }}"
88 login_db : " {{ item.db }}"
9- login_unix_socket : " {{ postgresql_unix_socket_dir }} "
9+ login_host : " 127.0.0.1 "
1010 login_port : " {{ postgresql_port }}"
11+ login_user : " {{ patroni_superuser_username }}"
12+ login_password : " {{ patroni_superuser_password }}"
1113 state : present
1214 ignore_errors : true
1315 loop : " {{ postgresql_schemas | flatten(1) }}"
You can’t perform that action at this time.
0 commit comments