New ACL settings. postgres port for pg_basebackup.

This commit is contained in:
Andrea Dell'Amico 2021-04-08 16:06:02 +02:00
parent 9f188f044a
commit b5a43c3acd
2 changed files with 20 additions and 2 deletions

View File

@ -34,7 +34,7 @@
- ('{{ pgpool_recovery_user }}' != 'postgres')
- pgpool_recovery_user_pwd is defined
- name: Configure the replication user permissions on deb
- name: Configure the global replication user permissions on deb when no password has been defined
postgresql_pg_hba:
dest: '{{ psql_conf_dir }}/pg_hba.conf'
contype: host
@ -52,6 +52,24 @@
- pgpool_recovery_user_pwd is not defined
notify: Reload postgresql
- name: Configure the replication user permissions for the replication DB on deb when no password has been defined
postgresql_pg_hba:
dest: '{{ psql_conf_dir }}/pg_hba.conf'
contype: host
users: '{{ pgpool_recovery_user }}'
address: '{{ item.1 }}'
databases: 'replication'
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

View File

@ -39,7 +39,7 @@ logger "pgpool_recovery_1: touched the backup_in_progress file"
# Perform a backup of the database.
ssh -T $RECOVERY_TARGET \
"pg_basebackup -h $MASTER_HOST -D $RECOVERY_DATA"
"pg_basebackup -h $MASTER_HOST -p {{ psql_db_port }} -D $RECOVERY_DATA"
logger "pgpool_recovery_1: backup of the database from $MASTER_HOST to $RECOVERY_TARGET"