1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

update restic systemd init

This commit is contained in:
L3D 2021-04-29 15:13:19 +02:00
parent 93b9de9826
commit 0a3637f1d4
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 14 additions and 2 deletions

View file

@ -82,7 +82,19 @@
- item.name is defined - item.name is defined
- item.scheduled | default(false) - item.scheduled | default(false)
- name: Enable restic timer - name: Enable restic service
become: true
ansible.builtin.systemd:
name: "restic-{{ item.name | replace(' ', '') | string }}.service"
enabled: true
daemon_reload: true
with_items: '{{ restic_backups }}'
when:
- restic_create_cron
- item.name is defined
- item.scheduled | default(false)
- name: Enable and start restic timer
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
name: "restic-{{ item.name | replace(' ', '') | string }}.timer" name: "restic-{{ item.name | replace(' ', '') | string }}.timer"

View file

@ -10,5 +10,5 @@ restic_os_variables:
paths: paths:
- 'vars' - 'vars'
playbook_version_number: 3 # should be int playbook_version_number: 4 # should be int
playbook_version_path: 'do1jlr.restic.version' playbook_version_path: 'do1jlr.restic.version'