Only enable the backup units, do not start them during the playbook as there's a timer for that
This commit is contained in:
parent
19995fee01
commit
13d9607e61
1 changed files with 10 additions and 12 deletions
|
@ -81,7 +81,7 @@
|
||||||
dest: "/etc/systemd/system/restic@.service"
|
dest: "/etc/systemd/system/restic@.service"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 'u+rwx'
|
mode: 'u+rw'
|
||||||
register: unit
|
register: unit
|
||||||
when: "ansible_os_family == 'Debian'"
|
when: "ansible_os_family == 'Debian'"
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
dest: "/etc/systemd/system/restic@.timer"
|
dest: "/etc/systemd/system/restic@.timer"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 'u+rwx'
|
mode: 'u+rw'
|
||||||
register: unit
|
register: unit
|
||||||
when: "ansible_os_family == 'Debian'"
|
when: "ansible_os_family == 'Debian'"
|
||||||
|
|
||||||
|
@ -100,9 +100,8 @@
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: unit.changed
|
when: unit.changed
|
||||||
|
|
||||||
- name: "Restart systemd units for restic"
|
- name: "Enable systemd units for restic"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
state: restarted
|
|
||||||
enabled: true
|
enabled: true
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -110,14 +109,13 @@
|
||||||
- "restic@{{ inventory_hostname }}.timer"
|
- "restic@{{ inventory_hostname }}.timer"
|
||||||
when: unit.changed
|
when: unit.changed
|
||||||
|
|
||||||
- name: "Enable systemd units for restic-wasabi"
|
#- name: "Enable systemd units for restic-wasabi"
|
||||||
ansible.builtin.systemd:
|
# ansible.builtin.systemd:
|
||||||
state: started
|
# enabled: true
|
||||||
enabled: true
|
# name: "{{ item }}"
|
||||||
name: "{{ item }}"
|
# with_items:
|
||||||
with_items:
|
# - "restic@{{ inventory_hostname }}.service"
|
||||||
- "restic@{{ inventory_hostname }}.service"
|
# - "restic@{{ inventory_hostname }}.timer"
|
||||||
- "restic@{{ inventory_hostname }}.timer"
|
|
||||||
|
|
||||||
#- name: "Cronjob for Backups"
|
#- name: "Cronjob for Backups"
|
||||||
# ansible.builtin.cron:
|
# ansible.builtin.cron:
|
||||||
|
|
Loading…
Reference in a new issue