cleanup.yml 795 B

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. - name: Ensure /iscsidisk is not mounted
  3. hosts: initiators
  4. become: true
  5. tasks:
  6. - name: the /iscsidisk file system is unmounted
  7. mount:
  8. path: /iscsidisk
  9. state: absent
  10. - name: the iSCSI target is disconnected
  11. open_iscsi:
  12. portal: 172.25.250.13
  13. port: '3260'
  14. target: iqn.2014-06.com.example:store1
  15. discover: no
  16. login: no
  17. auto_node_startup: no
  18. ignore_errors: yes
  19. - name: the iscsi-initiator-utils package is not installed
  20. yum:
  21. name: iscsi-initiator-utils
  22. state: absent
  23. - name: the iSCSI configuration files are not present
  24. file:
  25. path: "{{ item }}"
  26. state: absent
  27. loop:
  28. - /etc/iscsi
  29. - /var/lib/iscsi
  30. - /var/lock/iscsi