48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
---
|
|
- name: Template sanoid configuration
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: sanoid.conf.j2
|
|
dest: "/etc/sanoid/sanoid.conf"
|
|
owner: "{{ sanoid_user }}"
|
|
group: "{{ sanoid_user_group }}"
|
|
mode: "0400"
|
|
|
|
- name: Ensure systemd services are templated
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: "{{ item }}.j2"
|
|
dest: /etc/systemd/system/{{ item }}
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify:
|
|
- systemctl daemon-reload
|
|
loop:
|
|
- sanoid_mail.service
|
|
|
|
- name: add overrides (sanoid_mail + TZ)
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: "overrides.j2"
|
|
mode: "0644"
|
|
owner: root
|
|
group: root
|
|
dest: /lib/systemd/system/sanoid.service.d/override.conf
|
|
notify:
|
|
- systemctl daemon-reload
|
|
|
|
- name: add timer overrides
|
|
become: true
|
|
ansible.builtin.blockinfile:
|
|
create: true
|
|
mode: "0644"
|
|
owner: root
|
|
group: root
|
|
path: /lib/systemd/system/sanoid.timer.d/override.conf
|
|
block: |
|
|
[Timer]
|
|
OnCalendar = {{ sanoid_timer }}
|
|
when: sanoid_timer is defined
|
|
notify:
|
|
- systemctl daemon-reload
|