main.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Install cluster metrics templates
  3. copy:
  4. src: cluster-metrics
  5. dest: /etc/origin/
  6. - name: Create InfluxDB Services
  7. command: >
  8. {{ openshift.common.client_binary }} create -f
  9. /etc/origin/cluster-metrics/influxdb.yaml
  10. register: oex_influxdb_services
  11. failed_when: "'already exists' not in oex_influxdb_services.stderr and oex_influxdb_services.rc != 0"
  12. changed_when: false
  13. - name: Create Heapster Service Account
  14. command: >
  15. {{ openshift.common.client_binary }} create -f
  16. /etc/origin/cluster-metrics/heapster-serviceaccount.yaml
  17. register: oex_heapster_serviceaccount
  18. failed_when: "'already exists' not in oex_heapster_serviceaccount.stderr and oex_heapster_serviceaccount.rc != 0"
  19. changed_when: false
  20. - name: Add cluster-reader role to Heapster
  21. command: >
  22. {{ openshift.common.admin_binary }} policy
  23. add-cluster-role-to-user
  24. cluster-reader
  25. system:serviceaccount:default:heapster
  26. register: oex_cluster_header_role
  27. failed_when: "'already exists' not in oex_cluster_header_role.stderr and oex_cluster_header_role.rc != 0"
  28. changed_when: false
  29. - name: Create Heapster Services
  30. command: >
  31. {{ openshift.common.client_binary }} create -f
  32. /etc/origin/cluster-metrics/heapster.yaml
  33. register: oex_heapster_services
  34. failed_when: "'already exists' not in oex_heapster_services.stderr and oex_heapster_services.rc != 0"
  35. changed_when: false
  36. - name: Create Grafana Services
  37. command: >
  38. {{ openshift.common.client_binary }} create -f
  39. /etc/origin/cluster-metrics/grafana.yaml
  40. register: oex_grafana_services
  41. failed_when: "'already exists' not in oex_grafana_services.stderr and oex_grafana_services.rc != 0"
  42. changed_when: false