library/roles/postgresql: Fix the pgpass creation.
This commit is contained in:
parent
5f73bac089
commit
d3d621802f
|
@ -40,7 +40,9 @@ if [ $PG_BACKUP_ENABLED == 'True' ] ; then
|
|||
if [ ! -d $LOG_DIR ] ; then
|
||||
mkdir -p $LOG_DIR
|
||||
fi
|
||||
$PG_BCK_BIN > $LOG_FILE 2>&1
|
||||
echo "Starting the backup procedure" > $LOG_FILE
|
||||
$PG_BCK_BIN >> $LOG_FILE 2>&1
|
||||
echo "Backup procedure finished" >> $LOG_FILE
|
||||
fi
|
||||
else
|
||||
echo "Postgresql backups administratively disabled" > $LOG_FILE
|
||||
|
|
|
@ -23,3 +23,6 @@
|
|||
when: psql_wal_files_archiving_enabled
|
||||
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
||||
|
||||
- name: authorization file for the psql command
|
||||
template: src=pgpass.j2 dest={{ pg_backup_pass_file }} owner=root mode=0600
|
||||
tags: [ 'pg_backup', 'postgresql', 'postgres', 'pgpass' ]
|
||||
|
|
|
@ -17,6 +17,3 @@
|
|||
notify: Restart postgresql
|
||||
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
|
||||
|
||||
- name: authorization file for the psql command
|
||||
template: src=pgpass.j2 dest={{ pg_backup_pass_file }} owner=root mode=0600
|
||||
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# Loop psql_db_data to add multiple databases
|
||||
{% if psql_db_data is defined %}
|
||||
{% for db in psql_db_data %}
|
||||
{%if db.pwd is defined %}
|
||||
{% if db.pwd is defined %}
|
||||
{% if db.managedb is defined and db.managedb %}
|
||||
{{ psql_db_host }}:{{ psql_db_port }}:{{ db.name }}:{{ db.user }}:{{ db.pwd }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue