r/wal-g-pg: Schedule daily backups

WAL archives are not much good without a base backup onto which they
can be applied.  Thus, we need to schedule WAL-G to create and upload a
backup periodically.
This commit is contained in:
2024-07-02 11:54:41 -05:00
parent b83c6de28a
commit 090ebb0c1b
5 changed files with 60 additions and 0 deletions

View File

@@ -34,5 +34,40 @@
tags:
- selinux
- name: ensure wal-g backup timer is installed
template:
src: wal-g-backup.timer.j2
dest: /etc/systemd/system/wal-g-backup.timer
owner: root
group: root
mode: u=rw,go=r
notify:
- restart wal-g backup timer
tags:
- systemd
- name: ensure wal-g backup service is installed
copy:
src: wal-g-backup.service
dest: /etc/systemd/system/wal-g-backup.service
owner: root
group: root
mode: u=rw,go=r
tags:
- systemd
- name: ensure wal-g backup timer is enabled
systemd:
name: wal-g-backup.timer
enabled: true
tags:
- service
- name: flush handlers
meta: flush_handlers
- name: ensure wal-g backup timer is running
systemd:
name: wal-g-backup.timer
state: started
tags:
- service