From 6962f09c1dbb4e963b32667d7106a3c547a35a0f Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Wed, 15 Mar 2017 09:16:17 -0500 Subject: Cherry picked from #3657 --- roles/openshift_metrics/defaults/main.yaml | 2 +- roles/openshift_metrics/tasks/install_cassandra.yaml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'roles/openshift_metrics') diff --git a/roles/openshift_metrics/defaults/main.yaml b/roles/openshift_metrics/defaults/main.yaml index db4a0e1fc..5921b7bb7 100644 --- a/roles/openshift_metrics/defaults/main.yaml +++ b/roles/openshift_metrics/defaults/main.yaml @@ -47,7 +47,7 @@ openshift_metrics_node_id: nodename openshift_metrics_project: openshift-infra openshift_metrics_cassandra_pvc_prefix: "{{ openshift_hosted_metrics_storage_volume_name | default('metrics-cassandra') }}" -openshift_metrics_cassandra_pvc_access: "{{ openshift_hosted_metrics_storage_access_modes | default('ReadWriteOnce') }}" +openshift_metrics_cassandra_pvc_access: "{{ openshift_hosted_metrics_storage_access_modes | default(['ReadWriteOnce']) }}" openshift_metrics_hawkular_user_write_access: False diff --git a/roles/openshift_metrics/tasks/install_cassandra.yaml b/roles/openshift_metrics/tasks/install_cassandra.yaml index 66c81562b..a467c1a51 100644 --- a/roles/openshift_metrics/tasks/install_cassandra.yaml +++ b/roles/openshift_metrics/tasks/install_cassandra.yaml @@ -22,6 +22,9 @@ with_sequence: count={{ openshift_metrics_cassandra_replicas }} changed_when: false +- set_fact: openshift_metrics_cassandra_pvc_prefix="hawkular-metrics" + when: "not openshift_metrics_cassandra_pvc_prefix or openshift_metrics_cassandra_pvc_prefix == ''" + - name: generate hawkular-cassandra persistent volume claims template: src: pvc.j2 @@ -30,8 +33,7 @@ obj_name: "{{ openshift_metrics_cassandra_pvc_prefix }}-{{ item }}" labels: metrics-infra: hawkular-cassandra - access_modes: - - "{{ openshift_metrics_cassandra_pvc_access }}" + access_modes: "{{ openshift_metrics_cassandra_pvc_access | list }}" size: "{{ openshift_metrics_cassandra_pvc_size }}" with_sequence: count={{ openshift_metrics_cassandra_replicas }} when: @@ -49,8 +51,7 @@ metrics-infra: hawkular-cassandra annotations: volume.alpha.kubernetes.io/storage-class: dynamic - access_modes: - - "{{ openshift_metrics_cassandra_pvc_access }}" + access_modes: "{{ openshift_metrics_cassandra_pvc_access | list }}" size: "{{ openshift_metrics_cassandra_pvc_size }}" with_sequence: count={{ openshift_metrics_cassandra_replicas }} when: openshift_metrics_cassandra_storage_type == 'dynamic' -- cgit v1.2.3