diff options
Diffstat (limited to 'roles/openshift_metrics/tasks')
-rw-r--r-- | roles/openshift_metrics/tasks/install_metrics.yaml | 24 | ||||
-rw-r--r-- | roles/openshift_metrics/tasks/install_support.yaml | 5 | ||||
-rw-r--r-- | roles/openshift_metrics/tasks/main.yaml | 27 | ||||
-rw-r--r-- | roles/openshift_metrics/tasks/uninstall_metrics.yaml (renamed from roles/openshift_metrics/tasks/cleanup.yaml) | 0 |
4 files changed, 32 insertions, 24 deletions
diff --git a/roles/openshift_metrics/tasks/install_metrics.yaml b/roles/openshift_metrics/tasks/install_metrics.yaml index 5d95fa112..db023e6a2 100644 --- a/roles/openshift_metrics/tasks/install_metrics.yaml +++ b/roles/openshift_metrics/tasks/install_metrics.yaml @@ -1,17 +1,9 @@ --- -# This is the base configuration for installing the other components -- name: Create temp directory for doing work in - command: mktemp -td openshift-metrics-ansible-XXXXXX - register: mktemp - changed_when: False - -- debug: msg="Created temp dir {{mktemp.stdout}}" - -- name: Create temp directory for all our templates - file: path={{mktemp.stdout}}/templates state=directory mode=0755 - changed_when: False - -- include: generate_certificates.yaml -- include: generate_serviceaccounts.yaml -- include: generate_services.yaml -- include: generate_rolebindings.yaml +- name: Install Metrics + include: "{{ role_path }}/tasks/install_{{ include_file }}.yaml" + with_items: + - support + - heapster + - hawkular + loop_control: + loop_var: include_file diff --git a/roles/openshift_metrics/tasks/install_support.yaml b/roles/openshift_metrics/tasks/install_support.yaml new file mode 100644 index 000000000..b0e4bec80 --- /dev/null +++ b/roles/openshift_metrics/tasks/install_support.yaml @@ -0,0 +1,5 @@ +--- +- include: generate_certificates.yaml +- include: generate_serviceaccounts.yaml +- include: generate_services.yaml +- include: generate_rolebindings.yaml diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml index 79aae1e0b..adedd4069 100644 --- a/roles/openshift_metrics/tasks/main.yaml +++ b/roles/openshift_metrics/tasks/main.yaml @@ -2,20 +2,31 @@ - name: check that hawkular_metrics_hostname is set fail: msg='the openshift_metrics_hawkular_metrics_hostname variable is required' when: "{{ openshift_metrics_hawkular_metrics_hostname is not defined }}" + - name: check the value of openshift_metrics_hawkular_cassandra_storage_type fail: msg: > openshift_metrics_hawkular_cassandra_storage_type ({{ openshift_metrics_hawkular_cassandra_storage_type }}) is invalid, must be one of: emptydir, pv, dynamic when: openshift_metrics_hawkular_cassandra_storage_type not in openshift_metrics_hawkular_cassandra_storage_types -- name: Install Metrics - include: "{{ role_path }}/tasks/install_{{ include_file }}.yaml" - with_items: - - metrics - - heapster - - hawkular - loop_control: - loop_var: include_file + +- name: Create temp directory for doing work in + command: mktemp -td openshift-metrics-ansible-XXXXXX + register: mktemp + changed_when: False + +- debug: msg="Created temp dir {{mktemp.stdout}}" + +- name: Create temp directory for all our templates + file: path={{mktemp.stdout}}/templates state=directory mode=0755 + changed_when: False + +- include: "{{role_path}}/tasks/install_metrics.yaml" + when: openshift_metrics_install_metrics | default(false) | bool + +- include: "{{role_path}}/tasks/uninstall_metrics.yaml" + when: not openshift_metrics_install_metrics | default(false) | bool + - name: create objects command: > {{ openshift.common.client_binary }} -n '{{ openshift_metrics_project }}' diff --git a/roles/openshift_metrics/tasks/cleanup.yaml b/roles/openshift_metrics/tasks/uninstall_metrics.yaml index a29faef31..a29faef31 100644 --- a/roles/openshift_metrics/tasks/cleanup.yaml +++ b/roles/openshift_metrics/tasks/uninstall_metrics.yaml |