diff --git a/templates/postgresql-backup-script.sh b/templates/postgresql-backup-script.sh index 326fdc5..cf51a67 100644 --- a/templates/postgresql-backup-script.sh +++ b/templates/postgresql-backup-script.sh @@ -15,6 +15,9 @@ create_backup_dir() { backup_databases() { {% for db in postgresql_backup.databases %} + {% if db.password -%} + export PGPASSWORD="{{ db.password }}" + {% endif %} if (umask 077 && pg_dump -F c -h "{{ db.host | default( 'localhost' ) }}" -U "{{ db.user | default( 'postgres' ) }}" -p "{{ db.port | default( '5432' ) }}" "{{ db.name }}" -f "{{ db.name }}.in_progress.psql"); then mv "{{ db.name }}.in_progress.psql" "{{ db.name }}.psql" else diff --git a/vars/main.yml b/vars/main.yml index db42e90..f5f1060 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,6 @@ --- # versionscheck -playbook_version_number: 15 # should be int +playbook_version_number: 16 # should be int playbook_version_path: 'role-postgresql-backup_roles-ansible_github.com.version' # unique string _postgresql_backup: