uninstall.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. - include_role:
  3. name: lib_openshift
  4. - name: Uninstall CFME - ManageIQ
  5. debug:
  6. msg: Uninstalling Cloudforms Management Engine - ManageIQ
  7. - name: Ensure the CFME project is removed
  8. oc_project:
  9. state: absent
  10. name: "{{ openshift_cfme_project }}"
  11. - name: Ensure the CFME template is removed
  12. oc_obj:
  13. namespace: "{{ openshift_cfme_project }}"
  14. state: absent
  15. kind: template
  16. name: manageiq
  17. - name: Ensure the CFME PVs are removed
  18. oc_obj:
  19. state: absent
  20. all_namespaces: True
  21. kind: pv
  22. name: "{{ item }}"
  23. with_items: "{{ openshift_cfme_pv_exports }}"
  24. when: not (openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce'))
  25. - name: Ensure the CFME user is removed
  26. oc_user:
  27. state: absent
  28. username: "{{ openshift_cfme_user }}"
  29. - name: Ensure the CFME NFS Exports are removed
  30. file:
  31. path: /etc/exports.d/openshift_cfme.exports
  32. state: absent
  33. register: nfs_exports_removed
  34. when: not (openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce'))
  35. - name: Ensure the NFS export table is refreshed if exports were removed
  36. command: exportfs -ar
  37. when:
  38. - nfs_exports_removed.changed
  39. - not (openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce'))