install_metrics.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ---
  2. - include: pre_install.yaml
  3. - name: Install Metrics
  4. include: "{{ role_path }}/tasks/install_{{ include_file }}.yaml"
  5. with_items:
  6. - support
  7. - heapster
  8. - hawkular
  9. - cassandra
  10. loop_control:
  11. loop_var: include_file
  12. when: not openshift_metrics_heapster_standalone | bool
  13. - name: Install Heapster Standalone
  14. include: install_heapster.yaml
  15. when: openshift_metrics_heapster_standalone | bool
  16. - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
  17. register: object_def_files
  18. changed_when: no
  19. - slurp: src={{item.path}}
  20. register: object_defs
  21. with_items: "{{object_def_files.files}}"
  22. changed_when: no
  23. - name: Create objects
  24. include: oc_apply.yaml
  25. vars:
  26. kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
  27. namespace: "{{ openshift_metrics_project }}"
  28. file_name: "{{ item.source }}"
  29. file_content: "{{ item.content | b64decode | from_yaml }}"
  30. with_items: "{{ object_defs.results }}"
  31. - include: update_master_config.yaml
  32. - command: >
  33. {{openshift.common.client_binary}}
  34. --config={{mktemp.stdout}}/admin.kubeconfig
  35. get rc
  36. -l metrics-infra
  37. -o name
  38. -n {{openshift_metrics_project}}
  39. register: existing_metrics_rc
  40. changed_when: no
  41. - name: Scaling down cluster to recognize changes
  42. include: stop_metrics.yaml
  43. when: existing_metrics_rc.stdout_lines | length > 0
  44. - name: Scaling up cluster
  45. include: start_metrics.yaml
  46. tags: openshift_metrics_start_cluster
  47. when:
  48. - openshift_metrics_start_cluster | default(true) | bool