|
@@ -0,0 +1,50 @@
|
|
|
+---
|
|
|
+
|
|
|
+- name: Install cluster metrics templates
|
|
|
+ copy:
|
|
|
+ src: cluster-metrics
|
|
|
+ dest: /etc/openshift/
|
|
|
+
|
|
|
+- name: Create InfluxDB Services
|
|
|
+ command: >
|
|
|
+ {{ openshift.common.client_binary }} create -f
|
|
|
+ /etc/openshift/cluster-metrics/influxdb.yaml
|
|
|
+ register: oex_influxdb_services
|
|
|
+ failed_when: "'already exists' not in oex_influxdb_services.stderr and oex_influxdb_services.rc != 0"
|
|
|
+ changed_when: false
|
|
|
+
|
|
|
+- name: Create Heapster Service Account
|
|
|
+ command: >
|
|
|
+ {{ openshift.common.client_binary }} create -f
|
|
|
+ /etc/openshift/cluster-metrics/heapster-serviceaccount.yaml
|
|
|
+ register: oex_heapster_serviceaccount
|
|
|
+ failed_when: "'already exists' not in oex_heapster_serviceaccount.stderr and oex_heapster_serviceaccount.rc != 0"
|
|
|
+ changed_when: false
|
|
|
+
|
|
|
+- name: Add cluster-reader role to Heapster
|
|
|
+ command: >
|
|
|
+ {{ openshift.common.admin_binary }} policy
|
|
|
+ add-cluster-role-to-user
|
|
|
+ cluster-reader
|
|
|
+ system:serviceaccount:default:heapster
|
|
|
+ register: oex_cluster_header_role
|
|
|
+ register: oex_cluster_header_role
|
|
|
+ failed_when: "'already exists' not in oex_cluster_header_role.stderr and oex_cluster_header_role.rc != 0"
|
|
|
+ changed_when: false
|
|
|
+
|
|
|
+- name: Create Heapster Services
|
|
|
+ command: >
|
|
|
+ {{ openshift.common.client_binary }} create -f
|
|
|
+ /etc/openshift/cluster-metrics/heapster.yaml
|
|
|
+ register: oex_heapster_services
|
|
|
+ failed_when: "'already exists' not in oex_heapster_services.stderr and oex_heapster_services.rc != 0"
|
|
|
+ changed_when: false
|
|
|
+
|
|
|
+- name: Create Grafana Services
|
|
|
+ command: >
|
|
|
+ {{ openshift.common.client_binary }} create -f
|
|
|
+ /etc/openshift/cluster-metrics/grafana.yaml
|
|
|
+ register: oex_grafana_services
|
|
|
+ failed_when: "'already exists' not in oex_grafana_services.stderr and oex_grafana_services.rc != 0"
|
|
|
+ changed_when: false
|
|
|
+
|