diff --git a/roles/edpm_iscsid/tasks/install.yml b/roles/edpm_iscsid/tasks/install.yml index c5d38fa45..5b8b6ae52 100644 --- a/roles/edpm_iscsid/tasks/install.yml +++ b/roles/edpm_iscsid/tasks/install.yml @@ -46,12 +46,15 @@ - name: Gather services facts ansible.builtin.service_facts: - - name: Stop iscsi.service + - name: Stop and disable iscsi.service and iscsi-starter.service ansible.builtin.systemd: - name: iscsi.service + name: "{{ item }}" state: stopped enabled: false when: - - ansible_facts.services["iscsi.service"] is defined - - ansible_facts.services["iscsi.service"]["status"] != "not-found" - - ansible_facts.services["iscsi.service"]["status"] == "enabled" + - ansible_facts.services[item] is defined + - ansible_facts.services[item]["status"] != "not-found" + - ansible_facts.services[item]["status"] == "enabled" + loop: + - iscsi.service + - iscsi-starter.service