Use systemd rather than cron for sanoid
It's more reliable and easier to get logs
This commit is contained in:
parent
57d9c9d288
commit
decf5176f7
2 changed files with 17 additions and 5 deletions
|
@ -62,9 +62,17 @@
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Install cron job
|
- name: Install systemd services
|
||||||
cron:
|
file:
|
||||||
name: sanoid
|
src: /opt/sanoid/packages/debian/{{ item }}
|
||||||
special_time: hourly
|
dest: /lib/systemd/system/{{ item }}
|
||||||
job: TZ=UTC /usr/local/sbin/sanoid --cron --verbose
|
state: link
|
||||||
|
loop: "{{ sanoid_services }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Enable systemd services
|
||||||
|
service:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: true
|
||||||
|
loop: "{{ sanoid_services }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
4
ansible/roles/zfs/vars/main.yml
Normal file
4
ansible/roles/zfs/vars/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
sanoid_services:
|
||||||
|
- sanoid.timer
|
||||||
|
- sanoid.service
|
||||||
|
- sanoid-prune.service
|
Loading…
Reference in a new issue