- name: Stop and disable iscsid service
tags: step2
service: name=iscsid state=stopped enabled=no
- when: stat_iscsid_service.stat.exists
+ when: (stat_iscsid_service.stat|default('')).exists|default(false)
- name: stat /lib/systemd/system/iscsid.socket
tags: step2
stat: path=/lib/systemd/system/iscsid.socket
- name: Stop and disable iscsid.socket service
tags: step2
service: name=iscsid.socket state=stopped enabled=no
- when: stat_iscsid_socket.stat.exists
+ when: (stat_iscsid_socket.stat|default('')).exists|default(false)