2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Backup script for the postgresql database(s)
|
|
|
|
copy: src=postgresql-backup.sh dest=/usr/local/sbin/postgresql-backup owner=root mode=0744
|
2016-03-02 16:44:43 +01:00
|
|
|
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: cron job for the postgresql database(s) backup
|
|
|
|
copy: src=postgresql-backup.cron dest=/etc/cron.daily/postgresql-backup owner=root mode=0744
|
2016-03-02 16:44:43 +01:00
|
|
|
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: postgresql backup defaults
|
|
|
|
template: src=pg_backup-default.j2 dest=/etc/default/pg_backup owner=root mode=0744
|
2016-03-02 16:44:43 +01:00
|
|
|
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Create the postgresql backups data directory
|
|
|
|
file: dest={{ pg_backup_destdir }} owner=postgres group=postgres mode=700 recurse=yes state=directory
|
2016-03-02 16:44:43 +01:00
|
|
|
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
2016-06-07 18:26:14 +02:00
|
|
|
|
|
|
|
- name: Create the postgresql WAL files backup directories
|
|
|
|
file: dest={{ item }} owner=postgres group=postgres mode=700 recurse=yes state=directory
|
|
|
|
with_items:
|
|
|
|
- '{{ psql_wal_archiving_log_dir }}'
|
|
|
|
- '{{ psql_base_backup_dir }}'
|
|
|
|
when: psql_wal_files_archiving_enabled
|
|
|
|
tags: [ 'pg_backup', 'postgresql', 'postgres' ]
|
|
|
|
|
2016-11-28 18:38:54 +01:00
|
|
|
- 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' ]
|