main.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. - name: Set default image variables based on deployment_type
  3. include_vars: "{{ item }}"
  4. with_first_found:
  5. - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
  6. - "default_images.yml"
  7. - name: Set metrics image facts
  8. set_fact:
  9. openshift_metrics_image_prefix: "{{ openshift_metrics_image_prefix | default(__openshift_metrics_image_prefix) }}"
  10. openshift_metrics_image_version: "{{ openshift_metrics_image_version | default(__openshift_metrics_image_version) }}"
  11. - name: Create temp directory for doing work in on target
  12. command: mktemp -td openshift-metrics-ansible-XXXXXX
  13. register: mktemp
  14. changed_when: False
  15. - name: Create temp directory for all our templates
  16. file: path={{mktemp.stdout}}/templates state=directory mode=0755
  17. changed_when: False
  18. when: openshift_metrics_install_metrics | bool
  19. - name: Create temp directory local on control node
  20. local_action: command mktemp -d
  21. register: local_tmp
  22. changed_when: False
  23. become: false
  24. - name: Copy the admin client config(s)
  25. command: >
  26. cp {{ openshift.common.config_base}}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
  27. changed_when: False
  28. check_mode: no
  29. tags: metrics_init
  30. - include: "{{ (openshift_metrics_install_metrics | bool) | ternary('install_metrics.yaml','uninstall_metrics.yaml') }}"
  31. - name: Delete temp directory
  32. local_action: file path=local_tmp.stdout state=absent
  33. tags: metrics_cleanup
  34. changed_when: False
  35. check_mode: no