Setup the trust for the recovery user.
This commit is contained in:
parent
29fe0d4da3
commit
523152d08e
|
@ -7,7 +7,7 @@
|
||||||
- ansible_distribution_file_variety == "Debian"
|
- ansible_distribution_file_variety == "Debian"
|
||||||
tags: [ 'postgresql', 'postgres', 'pgpool' ]
|
tags: [ 'postgresql', 'postgres', 'pgpool' ]
|
||||||
|
|
||||||
- name: PgPool II configuration
|
- name: PgPool II users setup
|
||||||
block:
|
block:
|
||||||
- name: Add the postgres user that will manage the recovery, if not postgres
|
- name: Add the postgres user that will manage the recovery, if not postgres
|
||||||
become: True
|
become: True
|
||||||
|
@ -34,8 +34,28 @@
|
||||||
- ('{{ pgpool_recovery_user }}' != 'postgres')
|
- ('{{ pgpool_recovery_user }}' != 'postgres')
|
||||||
- pgpool_recovery_user_pwd is defined
|
- pgpool_recovery_user_pwd is defined
|
||||||
|
|
||||||
|
- name: Configure the replication user permissions on deb
|
||||||
|
postgresql_pg_hba:
|
||||||
|
dest: '{{ psql_conf_dir }}/pg_hba.conf'
|
||||||
|
contype: host
|
||||||
|
users: '{{ pgpool_recovery_user }}'
|
||||||
|
address: '{{ item.0.name }}'
|
||||||
|
databases: 'all'
|
||||||
|
method: 'trust'
|
||||||
|
state: present
|
||||||
|
with_subelements:
|
||||||
|
- '{{ psql_db_data | default([]) }}'
|
||||||
|
- allowed_hosts
|
||||||
|
when:
|
||||||
|
- psql_db_data is defined
|
||||||
|
- item.1 is defined
|
||||||
|
- pgpool_recovery_user_pwd is not defined
|
||||||
|
notify: Reload postgresql
|
||||||
|
|
||||||
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Create the ssh keys for the recovery user
|
- name: Create the ssh keys for the recovery user
|
||||||
user: user={{ pgpool_recovery_user }} generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa ssh_key_type=rsa
|
user: user={{ pgpool_recovery_user }} generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa ssh_key_type=ed25519
|
||||||
|
|
||||||
- name: Remember to trust the ssh keys between the two nodes
|
- name: Remember to trust the ssh keys between the two nodes
|
||||||
debug:
|
debug:
|
||||||
|
@ -47,6 +67,10 @@
|
||||||
- '{{ pgpool_backends | default([]) }}'
|
- '{{ pgpool_backends | default([]) }}'
|
||||||
- [ '{{ pgpool_recovery_stage1_script }}', '{{ pgpool_recovery_stage2_script }}', '{{ pgpool_remote_start_script }}' ]
|
- [ '{{ pgpool_recovery_stage1_script }}', '{{ pgpool_recovery_stage2_script }}', '{{ pgpool_remote_start_script }}' ]
|
||||||
|
|
||||||
|
tags: [ 'postgresql', 'postgres', 'pgpool', 'pgpool_user' ]
|
||||||
|
|
||||||
|
- name: PgPool II postgres setup
|
||||||
|
block:
|
||||||
- name: Set the postgresql configuration parameters needed by pgpool
|
- name: Set the postgresql configuration parameters needed by pgpool
|
||||||
action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}"
|
action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}"
|
||||||
with_items: '{{ psql_wal_files_conf }}'
|
with_items: '{{ psql_wal_files_conf }}'
|
||||||
|
|
Loading…
Reference in New Issue