main.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. - name: Install cluster metrics templates
  3. copy:
  4. src: cluster-metrics
  5. dest: /etc/openshift/
  6. - name: Create InfluxDB Services
  7. command: >
  8. {{ openshift.common.client_binary }} create -f
  9. /etc/openshift/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/openshift/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. register: oex_cluster_header_role
  28. failed_when: "'already exists' not in oex_cluster_header_role.stderr and oex_cluster_header_role.rc != 0"
  29. changed_when: false
  30. - name: Create Heapster Services
  31. command: >
  32. {{ openshift.common.client_binary }} create -f
  33. /etc/openshift/cluster-metrics/heapster.yaml
  34. register: oex_heapster_services
  35. failed_when: "'already exists' not in oex_heapster_services.stderr and oex_heapster_services.rc != 0"
  36. changed_when: false
  37. - name: Create Grafana Services
  38. command: >
  39. {{ openshift.common.client_binary }} create -f
  40. /etc/openshift/cluster-metrics/grafana.yaml
  41. register: oex_grafana_services
  42. failed_when: "'already exists' not in oex_grafana_services.stderr and oex_grafana_services.rc != 0"
  43. changed_when: false