summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorewolinetz <ewolinet@redhat.com>2017-05-09 12:07:30 -0500
committerewolinetz <ewolinet@redhat.com>2017-05-22 10:42:54 -0500
commitf204d6a0cb6f7e56e0ca9e62e9f329f815ebe816 (patch)
tree1cf5ce7162671990cf2559d93e4ab393a591f438 /roles
parent4bd31a37dec64a1ec898452a5622703798fc005d (diff)
downloadopenshift-f204d6a0cb6f7e56e0ca9e62e9f329f815ebe816.tar.gz
openshift-f204d6a0cb6f7e56e0ca9e62e9f329f815ebe816.tar.bz2
openshift-f204d6a0cb6f7e56e0ca9e62e9f329f815ebe816.tar.xz
openshift-f204d6a0cb6f7e56e0ca9e62e9f329f815ebe816.zip
Updating pvc generation names
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_logging/tasks/install_logging.yaml23
1 files changed, 20 insertions, 3 deletions
diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml
index 6083cdd26..da00ba34d 100644
--- a/roles/openshift_logging/tasks/install_logging.yaml
+++ b/roles/openshift_logging/tasks/install_logging.yaml
@@ -50,6 +50,9 @@
## Elasticsearch
+- set_fact: es_indices={{ es_indices | default([]) + [item | int - 1] }}
+ with_sequence: count={{ openshift_logging_facts.elasticsearch.deploymentconfigs.keys() | count }}
+
# TODO: add more vars
# We don't allow scaling down of ES nodes currently
- include_role:
@@ -57,10 +60,12 @@
vars:
generated_certs_dir: "{{openshift.common.config_base}}/logging"
openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
- openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
+# TODO: fix this logic when we have existing DC but no PVC
+ openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix ~ '-' ~ item.2 if item.1 is none else item.1 }}"
+##
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
- #openshift_logging_elasticsearch_storage_type: "{{ }}"
+ openshift_logging_elasticsearch_storage_type: "{{ 'pvc' if openshift_logging_es_pvc_dynamic | bool else 'emptydir' }}"
openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
@@ -68,6 +73,7 @@
with_together:
- "{{ openshift_logging_facts.elasticsearch.deploymentconfigs }}"
- "{{ openshift_logging_facts.elasticsearch.pvcs }}"
+ - "{{ es_indices }}"
# Create any new DC that may be required
- include_role:
@@ -77,15 +83,25 @@
openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix }}-{{ item | int + openshift_logging_facts.elasticsearch.deploymentconfigs | count }}"
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
+ openshift_logging_elasticsearch_storage_type: "{{ 'pvc' if openshift_logging_es_pvc_dynamic | bool else 'emptydir' }}"
+ openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
+ openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
+ openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
+
with_sequence: count={{ openshift_logging_es_cluster_size | int - openshift_logging_facts.elasticsearch.deploymentconfigs.keys() | count }}
+- set_fact: es_ops_indices={{ es_ops_indices | default([]) + [item | int - 1] }}
+ with_sequence: count={{ openshift_logging_facts.elasticsearch_ops.deploymentconfigs.keys() | count }}
+ when:
+ - openshift_logging_use_ops | bool
+
# TODO: add more vars
- include_role:
name: openshift_logging_elasticsearch
vars:
generated_certs_dir: "{{openshift.common.config_base}}/logging"
openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
- openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
+ openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix ~ '-' ~ item.2 if item.1 is none else item.1 }}"
openshift_logging_elasticsearch_ops_deployment: true
openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
@@ -97,6 +113,7 @@
with_together:
- "{{ openshift_logging_facts.elasticsearch_ops.deploymentconfigs }}"
- "{{ openshift_logging_facts.elasticsearch_ops.pvcs }}"
+ - "{{ es_ops_indices }}"
when:
- openshift_logging_use_ops | bool