This commit is contained in:
2026-01-29 12:55:01 +01:00
commit 65edf17dc7
15 changed files with 435 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
- name: Install pgBackRest
apt:
name: pgbackrest
state: present
- name: Repo dir
file:
path: /pgbackrest
state: directory
owner: postgres
mode: "750"
when: inventory_hostname in groups['replica']
- name: Config
template:
src: pgbackrest.conf.j2
dest: /etc/pgbackrest.conf
- name: Create stanza
become_user: postgres
command: pgbackrest --stanza=main stanza-create
when: inventory_hostname in groups['primary']
- name: Full backup weekly
cron:
name: "pgbackrest full"
weekday: 0
hour: 2
minute: 0
job: "pgbackrest --stanza=main backup --type=full"
- name: Incremental backup daily
cron:
name: "pgbackrest incr"
hour: 2
minute: 0
job: "pgbackrest --stanza=main backup --type=incr"