|
@@ -5,4 +5,34 @@
|
|
|
name: openshift-monitor-availability
|
|
|
description: Openshift availability monitoring applications.
|
|
|
|
|
|
+- name: Create temp directory for doing work in on target
|
|
|
+ command: mktemp -td openshift-monitor-availability-XXXXXX
|
|
|
+ register: mktemp
|
|
|
+ changed_when: False
|
|
|
+
|
|
|
+- name: Copy files to temp directory
|
|
|
+ copy:
|
|
|
+ src: "{{ role_path }}/files/"
|
|
|
+ dest: "{{ mktemp.stdout }}"
|
|
|
+
|
|
|
+- name: Copy admin client config
|
|
|
+ copy:
|
|
|
+ src: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
|
|
|
+ dest: "{{ mktemp.stdout }}/admin.kubeconfig"
|
|
|
+ remote_src: yes
|
|
|
+
|
|
|
+- name: Ensure Prometheus role exists
|
|
|
+ command: >
|
|
|
+ {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f {{ mktemp.stdout }}/prometheus-k8s-role.yaml
|
|
|
+
|
|
|
+- name: Ensure Prometheus role binding exists
|
|
|
+ command: >
|
|
|
+ {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f {{ mktemp.stdout }}/prometheus-k8s-role-binding.yaml
|
|
|
+
|
|
|
- import_tasks: install_monitor_app_create.yaml
|
|
|
+
|
|
|
+- name: Delete temp directory
|
|
|
+ file:
|
|
|
+ name: "{{ mktemp.stdout }}"
|
|
|
+ state: absent
|
|
|
+ changed_when: False
|