main.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ---
  2. - name: Copy Configuration to temporary conf
  3. command: >
  4. cp {{ openshift.common.config_base }}/master/admin.kubeconfig {{hawkular_tmp_conf}}
  5. changed_when: false
  6. - name: Create metrics-deployer Service Account
  7. shell: >
  8. echo {{ deployer_service_account | to_json | quote }} |
  9. {{ openshift.common.client_binary }} create
  10. -n openshift-infra
  11. --config={{hawkular_tmp_conf}}
  12. -f -
  13. register: deployer_create_service_account
  14. failed_when: "'already exists' not in deployer_create_service_account.stderr and deployer_create_service_account.rc != 0"
  15. changed_when: deployer_create_service_account.rc == 0
  16. - name: Create metrics-deployer Secret
  17. command: >
  18. {{ openshift.common.client_binary }}
  19. secrets new metrics-deployer
  20. nothing=/dev/null
  21. -n openshift-infra
  22. register: deployer_create_secret
  23. failed_when: "'already exists' not in deployer_create_secret.stderr and deployer_create_secret.rc !=0"
  24. changed_when: deployer_create_secret.rc == 0
  25. - name: Configure role/user permissions
  26. command: >
  27. {{ openshift.common.admin_binary }} {{item}}
  28. --config={{hawkular_tmp_conf}}
  29. with_items: "{{hawkular_permission_oc_commands}}"
  30. register: hawkular_perm_task
  31. failed_when: "'already exists' not in hawkular_perm_task.stderr and hawkular_perm_task.rc != 0"
  32. changed_when: hawkular_perm_task.rc == 0
  33. - name: Check openshift_master_default_subdomain
  34. fail:
  35. msg: "Default subdomain should be defined"
  36. when: openshift.master.default_subdomain is not defined
  37. - name: Create Heapster and Hawkular/Cassandra Services
  38. shell: >
  39. {{ openshift.common.client_binary }} process -f \
  40. /usr/share/openshift/examples/infrastructure-templates/{{ hawkular_type }}/metrics-deployer.yaml -v \
  41. HAWKULAR_METRICS_HOSTNAME=hawkular-metrics.{{ openshift.master.default_subdomain }},USE_PERSISTENT_STORAGE={{ hawkular_persistence }} | \
  42. {{ openshift.common.client_binary }} create -n openshift-infra -f -
  43. register: oex_heapster_services
  44. failed_when: "'already exists' not in oex_heapster_services.stderr and oex_heapster_services.rc != 0"
  45. changed_when: false
  46. - name: Clean temporary config file
  47. command: >
  48. rm -rf {{hawkular_tmp_conf}}
  49. changed_when: false