mirror of
https://github.com/roles-ansible/ansible_role_restic.git
synced 2024-12-11 23:41:32 +01:00
Review changes and fix some issues
This commit is contained in:
parent
e0f3f5c87c
commit
d238ef67d2
3 changed files with 24 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
|||
name: "restic-{{ item.name | replace(' ', '') | string }}.timer"
|
||||
state: 'restarted'
|
||||
daemon_reload: true
|
||||
masked: false
|
||||
with_items: '{{ restic_backups }}'
|
||||
when:
|
||||
- restic_create_schedule
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
name: "restic-{{ item.name | replace(' ', '') | string }}.service"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
masked: false
|
||||
with_items: '{{ restic_backups }}'
|
||||
notify: systemctl restart restic.timer
|
||||
when:
|
||||
|
@ -63,6 +64,7 @@
|
|||
enabled: true
|
||||
state: started
|
||||
daemon_reload: true
|
||||
masked: false
|
||||
with_items: '{{ restic_backups }}'
|
||||
notify: systemctl restart restic.timer
|
||||
when:
|
||||
|
@ -110,20 +112,33 @@
|
|||
no_log: true
|
||||
with_items: '{{ restic_backups }}'
|
||||
when:
|
||||
- restic_create_schedule
|
||||
- restic_create_schedule | bool
|
||||
- item.name is defined
|
||||
- item.scheduled | default(false)
|
||||
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false)
|
||||
- restic_schedule_type == "cronjob" or restic_force_cron | default(false)
|
||||
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false) or restic_schedule_type == "cronjob"
|
||||
|
||||
- name: make sure no unwanted systemd timer is available
|
||||
ansible.builtin.systemd:
|
||||
name: "restic-{{ item.name | replace(' ', '') | string }}.timer"
|
||||
state: stopped
|
||||
state: 'stopped'
|
||||
enabled: false
|
||||
masked: true
|
||||
with_items: '{{ restic_backups }}'
|
||||
when:
|
||||
- restic_create_schedule
|
||||
- restic_create_schedule | bool
|
||||
- item.name is defined
|
||||
- item.scheduled | default(false)
|
||||
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false)
|
||||
- restic_schedule_type == "cronjob" or restic_force_cron | default(false)
|
||||
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false) or restic_schedule_type == "cronjob"
|
||||
|
||||
- name: mask systemd service
|
||||
ansible.builtin.systemd:
|
||||
name: "restic-{{ item.name | replace(' ', '') | string }}.service"
|
||||
state: 'stopped'
|
||||
enabled: false
|
||||
masked: true
|
||||
with_items: '{{ restic_backups }}'
|
||||
when:
|
||||
- restic_create_schedule | bool
|
||||
- item.name is defined
|
||||
- item.scheduled | default(false)
|
||||
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false) or restic_schedule_type == "cronjob"
|
||||
|
|
|
@ -10,5 +10,5 @@ restic_os_variables:
|
|||
paths:
|
||||
- 'vars'
|
||||
|
||||
playbook_version_number: 13 # should be int
|
||||
playbook_version_number: 14 # should be int
|
||||
playbook_version_path: 'do1jlr.restic.version'
|
||||
|
|
Loading…
Reference in a new issue