Skip to content
Snippets Groups Projects

Only setup backup when rsnapshot is configured, don't use password for root auth

1 file
+ 21
18
Compare changes
  • Side-by-side
  • Inline
+ 21
18
@@ -36,23 +36,26 @@
state: started
enabled: true
- name: ensure we have our postgres backup script
copy:
src: "pgbackup{{ '-bullseye' if ansible_distribution_major_version|int(default=99) > 10 else '' }}.sh"
dest: /usr/local/bin/pgbackup.sh
owner: root
group: root
mode: '0755'
- name: configure snapshots
when: '"servers_rsnapshot" in group_names'
block:
- name: ensure we have our postgres backup script
copy:
src: "pgbackup{{ '-bullseye' if ansible_distribution_major_version|int(default=99) > 10 else '' }}.sh"
dest: /usr/local/bin/pgbackup.sh
owner: root
group: root
mode: '0755'
- name: ensure we have our rsnapshot config
copy:
src: rsnapshot.conf
dest: /etc/rsnapshot.d/postgres.conf
owner: root
group: root
mode: '0644'
- name: ensure we have our rsnapshot config
copy:
src: rsnapshot.conf
dest: /etc/rsnapshot.d/postgres.conf
owner: root
group: root
mode: '0644'
- name: remove obsolete crontab
file:
path: /etc/cron.d/postgres-snapshot
state: absent
- name: remove obsolete crontab
file:
path: /etc/cron.d/postgres-snapshot
state: absent
Loading