summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging_elasticsearch
diff options
context:
space:
mode:
authorJeff Cantrill <jcantril@redhat.com>2017-10-13 17:13:54 -0400
committerJeff Cantrill <jcantril@redhat.com>2017-10-17 14:53:52 -0400
commit46551d58d286fe18bb5637be2b9a21a928f05632 (patch)
treea35e997074e2901742c51b9ff211e448f62300a7 /roles/openshift_logging_elasticsearch
parent48126155eade2d030398f69dc5ee32838ec08480 (diff)
downloadopenshift-46551d58d286fe18bb5637be2b9a21a928f05632.tar.gz
openshift-46551d58d286fe18bb5637be2b9a21a928f05632.tar.bz2
openshift-46551d58d286fe18bb5637be2b9a21a928f05632.tar.xz
openshift-46551d58d286fe18bb5637be2b9a21a928f05632.zip
bug 1489498. preserve replica and shard settings
Diffstat (limited to 'roles/openshift_logging_elasticsearch')
-rw-r--r--roles/openshift_logging_elasticsearch/tasks/main.yaml8
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/main.yaml b/roles/openshift_logging_elasticsearch/tasks/main.yaml
index df2c17aa0..8380a25f9 100644
--- a/roles/openshift_logging_elasticsearch/tasks/main.yaml
+++ b/roles/openshift_logging_elasticsearch/tasks/main.yaml
@@ -153,13 +153,17 @@
when: es_logging_contents is undefined
changed_when: no
+- set_fact:
+ __es_num_of_shards: "{{ _es_configmap | default({}) | walk('index.number_of_shards', '1') }}"
+ __es_num_of_replicas: "{{ _es_configmap | default({}) | walk('index.number_of_replicas', '0') }}"
+
- template:
src: elasticsearch.yml.j2
dest: "{{ tempdir }}/elasticsearch.yml"
vars:
allow_cluster_reader: "{{ openshift_logging_elasticsearch_ops_allow_cluster_reader | lower | default('false') }}"
- es_number_of_shards: "{{ openshift_logging_es_number_of_shards | default(1) }}"
- es_number_of_replicas: "{{ openshift_logging_es_number_of_replicas | default(0) }}"
+ es_number_of_shards: "{{ openshift_logging_es_number_of_shards | default(None) or __es_num_of_shards }}"
+ es_number_of_replicas: "{{ openshift_logging_es_number_of_replicas | default(None) or __es_num_of_replicas }}"
es_kibana_index_mode: "{{ openshift_logging_elasticsearch_kibana_index_mode | default('unique') }}"
when: es_config_contents is undefined