logging-finish.yml 929 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. - name: Clean up after the logging exercise
  3. hosts: workstation.lab.example.com
  4. gather_subset: min
  5. become: no
  6. vars:
  7. ge_nsp: logging-central
  8. tasks:
  9. - name: Make sure kubeconfig is there on utility
  10. delegate_to: utility.lab.example.com
  11. file:
  12. path: /home/lab/{{ item }}/auth/kubeconfig
  13. state: file
  14. loop: "{{ clusters }}"
  15. - name: Create a temp dir
  16. file:
  17. path: tmp
  18. state: directory
  19. - name: Copy over the kubeconfig
  20. delegate_to: utility.lab.example.com
  21. fetch:
  22. src: /home/lab/{{ item }}/auth/kubeconfig
  23. dest: tmp/kubeconfig-{{ item }}
  24. flat: yes
  25. loop: "{{ clusters }}"
  26. - name: Ensure the namespace for the exercise is gone
  27. k8s:
  28. kubeconfig: tmp/kubeconfig-ocp4
  29. validate_certs: no
  30. api_version: v1
  31. kind: namespace
  32. name: "{{ ge_nsp }}"
  33. state: absent
  34. ...