--- - name: Ensure /data is cleaned up hosts: initiators become: true tasks: - name: the device does not contain a file system include_role: name: rhel-system-roles.storage vars: storage_volumes: - name: devdata state: absent type: disk disks: - "{{ item.key }}" mount_point: /data fs_type: xfs mount_options: '_netdev' loop: "{{ ansible_facts['devices'] | dict2items }}" when: item.value['model'] == "serverd.disk1" - name: the iSCSI target is disconnected open_iscsi: portal: 172.25.250.13 port: '3260' target: iqn.2014-06.com.example:serverd discover: no login: no auto_node_startup: no ignore_errors: yes - name: the iscsi-initiator-utils package is not installed yum: name: iscsi-initiator-utils state: absent - name: the iSCSI configuration files are not present file: path: "{{ item }}" state: absent loop: - /etc/iscsi - /var/lib/iscsi - /var/lock/iscsi