mirror of
https://gitea.0xace.cc/ansible-galaxy/wal-g-pg.git
synced 2025-06-28 21:23:08 +00:00
support enable/disable backups
This commit is contained in:
@ -19,4 +19,4 @@
|
||||
enabled: no
|
||||
masked: no
|
||||
daemon_reload: yes
|
||||
when: not backup_service.changed
|
||||
when: backup_service.changed
|
||||
|
@ -10,6 +10,5 @@
|
||||
name: backup.timer
|
||||
enabled: "{{ 'yes' if wal_g_backup_enable else 'no' }}"
|
||||
masked: no
|
||||
state: started
|
||||
state: "{{ 'started' if wal_g_backup_enable else 'stopped' }}"
|
||||
daemon_reload: yes
|
||||
when: not backup_timer.changed
|
||||
|
@ -19,4 +19,4 @@
|
||||
enabled: no
|
||||
masked: no
|
||||
daemon_reload: yes
|
||||
when: not backup_permanent_service.changed
|
||||
when: backup_permanent_service.changed
|
||||
|
@ -8,8 +8,7 @@
|
||||
- name: Enable and start systemd backup permanent timer
|
||||
systemd:
|
||||
name: backup-permanent.timer
|
||||
enabled: "{{ 'yes' if wal_g_backup_enable else 'no' }}"
|
||||
enabled: "{{ 'yes' if wal_g_backup_permanent_enable else 'no' }}"
|
||||
masked: no
|
||||
state: started
|
||||
state: "{{ 'started' if wal_g_backup_permanent_enable else 'stopped' }}"
|
||||
daemon_reload: yes
|
||||
when: not backup_permanent_timer.changed
|
||||
|
@ -19,5 +19,4 @@
|
||||
enabled: no
|
||||
masked: no
|
||||
daemon_reload: yes
|
||||
when: not backup_retention_service.changed
|
||||
|
||||
when: backup_retention_service.changed
|
||||
|
@ -8,8 +8,7 @@
|
||||
- name: Enable and start systemd backup retention timer
|
||||
systemd:
|
||||
name: backup-retention.timer
|
||||
enabled: "{{ 'yes' if wal_g_backup_enable else 'no' }}"
|
||||
enabled: "{{ 'yes' if wal_g_backup_retention_enable else 'no' }}"
|
||||
masked: no
|
||||
state: started
|
||||
state: "{{ 'started' if wal_g_backup_retention_enable else 'stopped' }}"
|
||||
daemon_reload: yes
|
||||
when: not backup_retention_timer.changed
|
||||
|
@ -17,40 +17,22 @@
|
||||
|
||||
- name: "Include install WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: pg.yaml
|
||||
when: wal_g_pg
|
||||
|
||||
- name: "Include backup job with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_job.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
|
||||
- name: "Include backup job timer with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_job_timer.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
- wal_g_backup_schedule is defined
|
||||
- wal_g_backup_schedule | length > 0
|
||||
|
||||
- name: "Include backup retention job with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_retention_job.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
|
||||
- name: "Include backup retention job timer with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_retention_job_timer.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
- wal_g_backup_retention_schedule is defined
|
||||
- wal_g_backup_retention_schedule | length > 0
|
||||
|
||||
- name: "Include permanent backup job with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_permanent_job.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
|
||||
- name: "Include permanent backup job timer with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_permanent_job_timer.yaml
|
||||
when:
|
||||
- wal_g_pg
|
||||
- wal_g_backup_permanent_schedule is defined
|
||||
- wal_g_backup_permanent_schedule | length > 0
|
||||
|
||||
- name: "Include backup retention job with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_retention_job.yaml
|
||||
|
||||
- name: "Include backup retention job timer with WAL-G {{ wal_g_version }} for PostgreSQL"
|
||||
include_tasks: backup_retention_job_timer.yaml
|
||||
|
||||
|
Reference in New Issue
Block a user