Merge branch 'master' of tpiccioli/ansible-roles into master

This commit is contained in:
Tommaso Piccioli 2019-12-06 17:33:27 +01:00 committed by Gitea
commit b30fd5329d
1 changed files with 18 additions and 3 deletions

View File

@ -1,11 +1,26 @@
--- ---
- name: Backup script for the postgresql database(s) - name: Backup script for the postgresql database(s)
copy: src=postgresql-backup.sh dest=/usr/local/sbin/postgresql-backup owner=root mode=0744 copy: src=postgresql-backup.sh dest=/usr/local/sbin/postgresql-backup owner=root mode=0744
tags: [ 'pg_backup', 'postgresql', 'postgres' ] copy: src=postgresql-backup.cron dest=/usr/local/sbin/postgresql-backup.cron owner=root mode=0744
tags: [ 'pgbackup_cron', 'pg_backup', 'postgresql', 'postgres' ]
- name: cron job for the postgresql database(s) backup - name: daily cron job for the postgresql database(s) backup
copy: src=postgresql-backup.cron dest=/etc/cron.daily/postgresql-backup owner=root mode=0744 copy: src=postgresql-backup.cron dest=/etc/cron.daily/postgresql-backup owner=root mode=0744
tags: [ 'pg_backup', 'postgresql', 'postgres' ] when: pgbackup_cron_step is undefined or
pgbackup_cron_step < 1 or
pgbackup_cron_step > 12
tags: [ 'pgbackup_cron', 'pg_backup', 'postgresql', 'postgres' ]
- name: hour step cron job for the postgresql database(s) backup
cron:
name: "hourly step postgresql dump"
minute: "10"
hour: "*/{{ pgbackup_cron_step }}"
job: "/usr/local/sbin/postgresql-backup.cron"
when: pgbackup_cron_step is defined and
pgbackup_cron_step >=1 and
pgbackup_cron_step <= 12
tags: [ 'pgbackup_cron', 'pg_backup', 'postgresql', 'postgres' ]
- name: postgresql backup defaults - name: postgresql backup defaults
template: src=pg_backup-default.j2 dest=/etc/default/pg_backup owner=root mode=0744 template: src=pg_backup-default.j2 dest=/etc/default/pg_backup owner=root mode=0744