---
- 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: metrics_create_template_dir | 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
