This commit is contained in:
parent
d75cc12335
commit
75a94c9ac3
2 changed files with 23 additions and 0 deletions
|
@ -14,3 +14,18 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
|
||||
- name: Generate Sanoid Configuration
|
||||
become: true
|
||||
community.general.ini_file:
|
||||
path: "/ets/systemd/system/{{ item }}"
|
||||
section: Unit
|
||||
state: present
|
||||
exclusive: no
|
||||
no_extra_spaces: no
|
||||
option: OnFailure
|
||||
value: sanoid_mail.service
|
||||
loop:
|
||||
- sanoid.service
|
||||
- sanoid-prune.service
|
||||
|
|
8
roles/mgrote.zfs_sanoid/templates/sanoid_mail.service.j2
Normal file
8
roles/mgrote.zfs_sanoid/templates/sanoid_mail.service.j2
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ file_header | default () }}
|
||||
|
||||
[Unit]
|
||||
Description=Send a Mail in case of an error in sanoid.service.
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c '/bin/systemctl status sanoid.service | mail -s "[ERROR] sanoid - %H" {{ empfaenger_mail }}'
|
Loading…
Reference in a new issue