unprovision.yml 1010 B

1234567891011121314151617181920212223242526272829303132333435
  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. when:
  11. - openshift_use_kuryr | default(false) | bool
  12. - name: Delete kuryr LoadBalancers (cascading)
  13. os_lbaas_deletion:
  14. lbaas_annotation: "{{ item.metadata.annotations }}"
  15. with_items: "{{ svc_output.results.results[0]['items'] if 'results' in svc_output else [] }}"
  16. when:
  17. - openshift_openstack_lbaasv2_provider == "Octavia"
  18. - not (item.metadata.name == "kubernetes")
  19. - openshift_use_kuryr | default(false) | bool
  20. - item.metadata.annotations is defined
  21. - name: Remove trunk subports
  22. os_subports_deletion:
  23. trunk_name: "{{ item }}"
  24. with_items: "{{ groups['cluster_hosts'] }}"
  25. when:
  26. - openshift_use_kuryr | default(false) | bool
  27. - name: Delete the Stack
  28. ignore_errors: False
  29. os_stack:
  30. name: "{{ openshift_openstack_stack_name }}"
  31. state: "absent"
  32. wait: yes