From f1b79129f12e7f9b4759e50ec644d840f0d1c24c Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Wed, 18 Dec 2019 11:57:02 +0100 Subject: [PATCH] add proxy options to ES_JAVA_OPTS when defined with es_proxy_host --- tasks/elasticsearch-plugins.yml | 1 - templates/elasticsearch.j2 | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/elasticsearch-plugins.yml b/tasks/elasticsearch-plugins.yml index e953ae0..7e1829a 100644 --- a/tasks/elasticsearch-plugins.yml +++ b/tasks/elasticsearch-plugins.yml @@ -75,7 +75,6 @@ CONF_DIR: "{{ es_conf_dir }}" ES_PATH_CONF: "{{ es_conf_dir }}" ES_INCLUDE: "{{ default_file }}" - ES_JAVA_OPTS: "{% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%} -Dhttp.proxyHost={{ item.proxy_host }} -Dhttp.proxyPort={{ item.proxy_port }} -Dhttps.proxyHost={{ item.proxy_host }} -Dhttps.proxyPort={{ item.proxy_port }} {% elif es_proxy_host is defined and es_proxy_host != '' %} -Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} -Dhttps.proxyHost={{ es_proxy_host }} -Dhttps.proxyPort={{ es_proxy_port }} {% endif %}" until: plugin_installed.rc == 0 retries: 5 delay: 5 diff --git a/templates/elasticsearch.j2 b/templates/elasticsearch.j2 index 84c4d75..2fc67ff 100644 --- a/templates/elasticsearch.j2 +++ b/templates/elasticsearch.j2 @@ -15,7 +15,7 @@ ES_PATH_CONF={{ es_conf_dir }} PID_DIR={{ es_pid_dir }} # Additional Java OPTS -ES_JAVA_OPTS= +ES_JAVA_OPTS="{% if es_proxy_host is defined and es_proxy_host != '' %}-Dhttp.proxyHost={{ es_proxy_host }} -Dhttp.proxyPort={{ es_proxy_port }} -Dhttps.proxyHost={{ es_proxy_host }} -Dhttps.proxyPort={{ es_proxy_port }}{% endif %}" # Configure restart on package upgrade (true, every other setting will lead to not restarting) #RESTART_ON_UPGRADE=true