Merge pull request #648 from jmlrt/fix-es_java_opts-646

add proxy options to ES_JAVA_OPTS when defined with es_proxy_host
This commit is contained in:
Julien Mailleret 2019-12-19 12:51:54 +01:00 committed by GitHub
commit 50321df03d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 15 deletions

View file

@ -212,8 +212,6 @@ A more complex example:
es_api_port: 9201 es_api_port: 9201
es_plugins: es_plugins:
- plugin: ingest-attachment - plugin: ingest-attachment
proxy_host: proxy.example.com
proxy_port: 8080
``` ```
#### Important Note #### Important Note
@ -470,17 +468,6 @@ To define proxy globally, set the following variables:
* ```es_proxy_host``` - global proxy host * ```es_proxy_host``` - global proxy host
* ```es_proxy_port``` - global proxy port * ```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 ## 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. * 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.

View file

@ -75,7 +75,6 @@
CONF_DIR: "{{ es_conf_dir }}" CONF_DIR: "{{ es_conf_dir }}"
ES_PATH_CONF: "{{ es_conf_dir }}" ES_PATH_CONF: "{{ es_conf_dir }}"
ES_INCLUDE: "{{ default_file }}" 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 until: plugin_installed.rc == 0
retries: 5 retries: 5
delay: 5 delay: 5

View file

@ -15,7 +15,7 @@ ES_PATH_CONF={{ es_conf_dir }}
PID_DIR={{ es_pid_dir }} PID_DIR={{ es_pid_dir }}
# Additional Java OPTS # 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) # Configure restart on package upgrade (true, every other setting will lead to not restarting)
#RESTART_ON_UPGRADE=true #RESTART_ON_UPGRADE=true