|
@@ -71,10 +71,17 @@
|
|
|
- set_fact: openshift_logging_es_pvc_prefix="logging-es"
|
|
|
when: openshift_logging_es_pvc_prefix == ""
|
|
|
|
|
|
+# Using this module for setting this fact because otherwise we were getting a value of "" trying to
|
|
|
+# use default() in the set_fact after this which caused us to not correctly evaluate
|
|
|
+# openshift_logging_elasticsearch_storage_type
|
|
|
+- conditional_set_fact:
|
|
|
+ facts: "{{ hostvars[inventory_hostname] }}"
|
|
|
+ vars:
|
|
|
+ elasticsearch_storage_type: openshift_logging_elasticsearch_storage_type
|
|
|
+
|
|
|
- set_fact:
|
|
|
- elasticsearch_storage_type: "{{ openshift_logging_elasticsearch_storage_type | default('pvc' if ( openshift_logging_es_pvc_dynamic | bool or openshift_hosted_logging_storage_kind | default('') == 'nfs' or openshift_logging_es_pvc_size | length > 0) else 'emptydir') }}"
|
|
|
+ default_elasticsearch_storage_type: "{{ 'pvc' if ( openshift_logging_es_pvc_dynamic | bool or openshift_logging_storage_kind | default('') == 'nfs' or openshift_logging_es_pvc_size | length > 0) else 'emptydir' }}"
|
|
|
|
|
|
-# We don't allow scaling down of ES nodes currently
|
|
|
- include_role:
|
|
|
name: openshift_logging_elasticsearch
|
|
|
vars:
|
|
@@ -85,7 +92,8 @@
|
|
|
openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
|
|
|
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
|
|
|
|
|
|
- openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type }}"
|
|
|
+ openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type | default('pvc' if outer_item.0.volumes['elasticsearch-storage'].persistentVolumeClaim is defined else 'hostmount' if outer_item.0.volumes['elasticsearch-storage'].hostPath is defined else 'emptydir' if outer_item.0.volumes['elasticsearch-storage'].emptyDir is defined else default_elasticsearch_storage_type) }}"
|
|
|
+ openshift_logging_elasticsearch_hostmount_path: "{{ outer_item.0.volumes['elasticsearch-storage'].hostPath.path if outer_item.0.volumes['elasticsearch-storage'].hostPath is defined else '' }}"
|
|
|
openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
|
|
|
openshift_logging_elasticsearch_pvc_storage_class_name: "{{ openshift_logging_es_pvc_storage_class_name | default() }}"
|
|
|
openshift_logging_elasticsearch_nodeselector: "{{ openshift_logging_es_nodeselector if outer_item.0.nodeSelector | default(None) is none else outer_item.0.nodeSelector }}"
|
|
@@ -112,7 +120,7 @@
|
|
|
openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
|
|
|
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
|
|
|
|
|
|
- openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type }}"
|
|
|
+ openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type | default(default_elasticsearch_storage_type) }}"
|
|
|
openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
|
|
|
openshift_logging_elasticsearch_pvc_storage_class_name: "{{ openshift_logging_es_pvc_storage_class_name | default() }}"
|
|
|
|
|
@@ -133,7 +141,7 @@
|
|
|
when: openshift_logging_es_ops_pvc_prefix == ""
|
|
|
|
|
|
- set_fact:
|
|
|
- elasticsearch_storage_type: "{{ openshift_logging_elasticsearch_storage_type | default('pvc' if ( openshift_logging_es_ops_pvc_dynamic | bool or openshift_hosted_logging_storage_kind | default('') == 'nfs' or openshift_logging_es_ops_pvc_size | length > 0) else 'emptydir') }}"
|
|
|
+ default_elasticsearch_storage_type: "{{ 'pvc' if ( openshift_logging_es_ops_pvc_dynamic | bool or openshift_logging_storage_kind | default('') == 'nfs' or openshift_logging_es_ops_pvc_size | length > 0) else 'emptydir' }}"
|
|
|
when:
|
|
|
- openshift_logging_use_ops | bool
|
|
|
|
|
@@ -147,7 +155,8 @@
|
|
|
openshift_logging_elasticsearch_ops_deployment: true
|
|
|
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
|
|
|
|
|
|
- openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type }}"
|
|
|
+ openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type | default('pvc' if outer_item.0.volumes['elasticsearch-storage'].persistentVolumeClaim is defined else 'hostmount' if outer_item.0.volumes['elasticsearch-storage'].hostPath is defined else 'emptydir' if outer_item.0.volumes['elasticsearch-storage'].emptyDir is defined else default_elasticsearch_storage_type) }}"
|
|
|
+ openshift_logging_elasticsearch_hostmount_path: "{{ outer_item.0.volumes['elasticsearch-storage'].hostPath.path if outer_item.0.volumes['elasticsearch-storage'].hostPath is defined else '' }}"
|
|
|
openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_ops_pvc_size }}"
|
|
|
openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_ops_pvc_dynamic }}"
|
|
|
openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_ops_pv_selector }}"
|
|
@@ -189,7 +198,7 @@
|
|
|
openshift_logging_elasticsearch_ops_deployment: true
|
|
|
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
|
|
|
|
|
|
- openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type }}"
|
|
|
+ openshift_logging_elasticsearch_storage_type: "{{ elasticsearch_storage_type | default(default_elasticsearch_storage_type) }}"
|
|
|
openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_ops_pvc_size }}"
|
|
|
openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_ops_pvc_dynamic }}"
|
|
|
openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_ops_pv_selector }}"
|