main.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. - name: Create temp directory for doing work in on target
  3. command: mktemp -td openshift-metrics-ansible-XXXXXX
  4. register: mktemp
  5. changed_when: False
  6. - name: Create temp directory for all our templates
  7. file: path={{mktemp.stdout}}/templates state=directory mode=0755
  8. changed_when: False
  9. when: openshift_metrics_install_metrics | bool
  10. - name: Create temp directory local on control node
  11. local_action: command mktemp -d
  12. register: local_tmp
  13. changed_when: False
  14. vars:
  15. ansible_become: false
  16. - name: Copy the admin client config(s)
  17. command: >
  18. cp {{ openshift.common.config_base}}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
  19. changed_when: False
  20. check_mode: no
  21. tags: metrics_init
  22. - include_tasks: install_metrics.yaml
  23. when:
  24. - openshift_metrics_install_metrics | bool
  25. - include_tasks: uninstall_metrics.yaml
  26. when:
  27. - not openshift_metrics_install_metrics | bool
  28. - include_tasks: uninstall_hosa.yaml
  29. when: not openshift_metrics_install_hawkular_agent | bool
  30. - name: Delete temp directory
  31. local_action: file path=local_tmp.stdout state=absent
  32. tags: metrics_cleanup
  33. changed_when: False
  34. check_mode: no
  35. vars:
  36. ansible_become: false