12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- ---
- - name: Create temp directory for doing work in on target
- command: mktemp -td openshift-metrics-ansible-XXXXXX
- register: mktemp
- changed_when: False
- - name: Create temp directory for all our templates
- file: path={{mktemp.stdout}}/templates state=directory mode=0755
- changed_when: False
- when: openshift_metrics_install_metrics | bool
- - name: Create temp directory local on control node
- local_action: command mktemp -d
- register: local_tmp
- changed_when: False
- vars:
- ansible_become: false
- - name: Copy the admin client config(s)
- command: >
- cp {{ openshift.common.config_base}}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
- changed_when: False
- check_mode: no
- tags: metrics_init
- - include_tasks: install_metrics.yaml
- when:
- - openshift_metrics_install_metrics | bool
- - include_tasks: uninstall_metrics.yaml
- when:
- - not openshift_metrics_install_metrics | bool
- - include_tasks: uninstall_hosa.yaml
- when: not openshift_metrics_install_hawkular_agent | bool
- - name: Delete temp directory
- local_action: file path=local_tmp.stdout state=absent
- tags: metrics_cleanup
- changed_when: False
- check_mode: no
- vars:
- ansible_become: false
|