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"
|
||||
become: true
|
||||
|
||||
- name: Install cron job
|
||||
cron:
|
||||
name: sanoid
|
||||
special_time: hourly
|
||||
job: TZ=UTC /usr/local/sbin/sanoid --cron --verbose
|
||||
- name: Install systemd services
|
||||
file:
|
||||
src: /opt/sanoid/packages/debian/{{ item }}
|
||||
dest: /lib/systemd/system/{{ item }}
|
||||
state: link
|
||||
loop: "{{ sanoid_services }}"
|
||||
become: true
|
||||
|
||||
- name: Enable systemd services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
enabled: true
|
||||
loop: "{{ sanoid_services }}"
|
||||
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