unprovision.yml 950 B

123456789101112131415161718192021222324252627282930313233
  1. ---
  2. - name: Get kuryr services
  3. delegate_to: "{{ groups.oo_first_master.0 }}"
  4. oc_obj:
  5. kind: endpoints
  6. state: list
  7. all_namespaces: true
  8. register: svc_output
  9. ignore_errors: true
  10. - name: Delete kuryr LoadBalancers (cascading)
  11. os_lbaas_deletion:
  12. lbaas_annotation: "{{ item.metadata.annotations }}"
  13. with_items: "{{ svc_output.results.results[0]['items'] if 'results' in svc_output else [] }}"
  14. when:
  15. - openshift_openstack_lbaasv2_provider == "Octavia"
  16. - not (item.metadata.name == "kubernetes")
  17. - openshift_use_kuryr|default(false) == true
  18. - item.metadata.annotations is defined
  19. - name: Remove trunk subports
  20. os_subports_deletion:
  21. trunk_name: "{{ item }}"
  22. with_items: "{{ groups['cluster_hosts'] }}"
  23. when:
  24. - openshift_use_kuryr|default(false) == true
  25. - name: Delete the Stack
  26. ignore_errors: False
  27. os_stack:
  28. name: "{{ openshift_openstack_stack_name }}"
  29. state: "absent"
  30. wait: yes