diff --git a/roles/mgrote.zfs_sanoid/handlers/main.yml b/roles/mgrote.zfs_sanoid/handlers/main.yml new file mode 100644 index 00000000..af34a24b --- /dev/null +++ b/roles/mgrote.zfs_sanoid/handlers/main.yml @@ -0,0 +1,14 @@ +--- + - name: systemctl daemon-reload + become: yes + ansible.builtin.systemd: + daemon_reload: yes + + - name: systemctl enable units + become: yes + ansible.builtin.systemd: + name: "{{ item }}" + enabled: yes + masked: no + with_items: + - sanoid_mail.service diff --git a/roles/mgrote.zfs_sanoid/tasks/main.yml b/roles/mgrote.zfs_sanoid/tasks/main.yml index d6d95a85..a39ffab8 100644 --- a/roles/mgrote.zfs_sanoid/tasks/main.yml +++ b/roles/mgrote.zfs_sanoid/tasks/main.yml @@ -15,8 +15,19 @@ 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: Generate Sanoid Configuration + + - name: add sanoid_mail.service to sanoid.service become: true community.general.ini_file: path: "/ets/systemd/system/{{ item }}"