library/roles/postgresql: Fix the pgpass creation.

This commit is contained in:
Andrea Dell'Amico 2016-11-28 18:38:54 +01:00
parent 5f73bac089
commit d3d621802f
4 changed files with 9 additions and 5 deletions

View File

@ -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

View 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' ]

View File

@ -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' ]

View File

@ -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 %}