60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
---
|
|
- name: install packages
|
|
become: true
|
|
ansible.builtin.package:
|
|
name:
|
|
- sanoid
|
|
state: present
|
|
|
|
- name: Generate Sanoid Configuration
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: sanoid.conf.j2
|
|
dest: /etc/sanoid/sanoid.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: template sanoid_mail.service
|
|
become: yes
|
|
ansible.builtin.template:
|
|
src: sanoid_mail.service.j2
|
|
dest: /etc/systemd/system/sanoid_mail.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- systemctl daemon-reload
|
|
|
|
|
|
- name: add sanoid_mail.service to sanoid.service
|
|
become: true
|
|
community.general.ini_file:
|
|
path: "/etc/systemd/system/{{ item }}"
|
|
section: Unit
|
|
state: present
|
|
no_extra_spaces: no
|
|
option: OnFailure
|
|
value: sanoid_mail.service
|
|
loop:
|
|
- sanoid.service
|
|
- sanoid-prune.service
|
|
notify:
|
|
- systemctl daemon-reload
|
|
|
|
- name: add sanoid_mail.service to sanoid.service
|
|
become: true
|
|
community.general.ini_file:
|
|
path: "/etc/systemd/system/{{ item }}"
|
|
section: Timer
|
|
state: present
|
|
no_extra_spaces: no
|
|
option: OnCalendar
|
|
value: "{{ sanoid_timer }}"
|
|
loop:
|
|
- sanoid.timer
|
|
notify:
|
|
- systemctl daemon-reload
|
|
|
|
# collections in meta?
|
|
# doku?
|