restic
This commit is contained in:
parent
b2ecad633b
commit
f7d5f7533e
1 changed files with 9 additions and 49 deletions
|
@ -51,63 +51,23 @@
|
|||
mode: "0600"
|
||||
no_log: "{{ no_debug | default('true') }}"
|
||||
|
||||
- name: template restic.mount
|
||||
- name: Ensure systemd services are templated
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: media-restic.mount.j2
|
||||
dest: /etc/systemd/system/media-restic.mount # media-restic == /media/restic
|
||||
src: "{{ item }}.j2"
|
||||
dest: /etc/systemd/system/{{ item }}
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
- systemctl enable units
|
||||
|
||||
- name: template restic.automount
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: media-restic.automount.j2
|
||||
dest: /etc/systemd/system/media-restic.automount
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
- systemctl enable units
|
||||
- systemctl start units
|
||||
|
||||
- name: template restic.service
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: restic.service.j2
|
||||
dest: /etc/systemd/system/restic.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
|
||||
- name: template restic.timer
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: restic.timer.j2
|
||||
dest: /etc/systemd/system/restic.timer
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
|
||||
- name: template restic_mail.service
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: "restic_mail.service.j2"
|
||||
dest: /etc/systemd/system/restic_mail.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
loop:
|
||||
- media-restic.mount # media-restic == /media/restic
|
||||
- media-restic.automount # media-restic == /media/restic
|
||||
- restic.service
|
||||
- restic.timer
|
||||
- restic_mail.service
|
||||
|
||||
- name: systemctl start restic.timer
|
||||
become: true
|
||||
|
|
Loading…
Reference in a new issue