diff --git a/README.md b/README.md index 88c663b..dae3061 100644 --- a/README.md +++ b/README.md @@ -212,8 +212,6 @@ A more complex example: es_api_port: 9201 es_plugins: - plugin: ingest-attachment - proxy_host: proxy.example.com - proxy_port: 8080 ``` #### Important Note @@ -470,17 +468,6 @@ To define proxy globally, set the following variables: * ```es_proxy_host``` - global proxy host * ```es_proxy_port``` - global proxy port -To define proxy only for a particular plugin during its installation: - -```yaml - es_plugins: - - plugin: ingest-attachment - proxy_host: proxy.example.com - proxy_port: 8080 -``` - -> For plugins installation, proxy_host and proxy_port are used first if they are defined and fallback to the global proxy settings if not. The same values are currently used for both the http and https proxy settings. - ## Notes * The role assumes the user/group exists on the server. The elasticsearch packages create the default elasticsearch user. If this needs to be changed, ensure the user exists. 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