v1.0
This commit is contained in:
37
roles/pgbackrest/tasks/main.yml
Normal file
37
roles/pgbackrest/tasks/main.yml
Normal 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"
|
||||
Reference in New Issue
Block a user