logging-finish.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. # TODO: remove the logging stack
  3. - name: Clean up after the logging exercise
  4. hosts: workstation.lab.example.com
  5. gather_subset: min
  6. become: no
  7. vars:
  8. ge_nsp: logging-central
  9. tasks:
  10. - name: Make sure kubeconfig is there on utility
  11. delegate_to: utility.lab.example.com
  12. file:
  13. path: /home/lab/{{ item }}/auth/kubeconfig
  14. state: file
  15. loop: "{{ clusters }}"
  16. - name: Create a temp dir
  17. file:
  18. path: tmp
  19. state: directory
  20. - name: Copy over the kubeconfig
  21. delegate_to: utility.lab.example.com
  22. fetch:
  23. src: /home/lab/{{ item }}/auth/kubeconfig
  24. dest: tmp/kubeconfig-{{ item }}
  25. flat: yes
  26. loop: "{{ clusters }}"
  27. - name: Ensure the namespace for the exercise is gone
  28. k8s:
  29. kubeconfig: tmp/kubeconfig-ocp4
  30. validate_certs: no
  31. api_version: v1
  32. kind: namespace
  33. name: "{{ ge_nsp }}"
  34. state: absent
  35. - name: Wait for the project to finish terminating
  36. k8s_info:
  37. kubeconfig: tmp/kubeconfig-ocp4
  38. validate_certs: no
  39. api_version: v1
  40. kind: namespace
  41. name: "{{ ge_nsp }}"
  42. register: ge_gone
  43. until: ge_gone.resources | length == 0
  44. retries: 30
  45. delay: 10
  46. ...