From c8633c8b1ea272862c83463d1cd857e8e3b4d73c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 1 Apr 2022 18:54:00 +0200 Subject: [PATCH] when --- roles/mgrote.zfs_sanoid/handlers/main.yml | 9 --------- roles/mgrote.zfs_sanoid/tasks/main.yml | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/roles/mgrote.zfs_sanoid/handlers/main.yml b/roles/mgrote.zfs_sanoid/handlers/main.yml index af34a24b..c73886d6 100644 --- a/roles/mgrote.zfs_sanoid/handlers/main.yml +++ b/roles/mgrote.zfs_sanoid/handlers/main.yml @@ -3,12 +3,3 @@ 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 6cc55e4e..e9313a21 100644 --- a/roles/mgrote.zfs_sanoid/tasks/main.yml +++ b/roles/mgrote.zfs_sanoid/tasks/main.yml @@ -14,6 +14,7 @@ owner: root group: root mode: 0644 + when: sanoid_datasets is defined and sanoid_templates is defined - name: template sanoid_mail.service become: yes @@ -26,7 +27,6 @@ notify: - systemctl daemon-reload - - name: add sanoid_mail.service to sanoid.service become: true community.general.ini_file: @@ -50,6 +50,7 @@ value: "{{ sanoid_timer }}" notify: - systemctl daemon-reload + when: sanoid_timer is defined # collections in meta? # doku?