Use systemd rather than cron for sanoid

It's more reliable and easier to get logs
This commit is contained in:
Jake Howard 2021-01-09 20:57:47 +00:00
parent 57d9c9d288
commit decf5176f7
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 17 additions and 5 deletions

View file

@ -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

View file

@ -0,0 +1,4 @@
sanoid_services:
- sanoid.timer
- sanoid.service
- sanoid-prune.service