Get elastic plugins via proxy

Some environments don't have routed internet and can only get data
via proxies. If proxy_env_url is set, try getting files via that.

Change-Id: I97b728484894e75ebc8c4e55b98b2e3eea42baf6
This commit is contained in:
Erik Berg 2021-01-07 11:18:29 +01:00 committed by Dmitriy Rabotyagov
parent b05893ae39
commit c7e76e119f

View File

@ -24,3 +24,11 @@
- name: Install plugins
command: "/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch --verbose {{ item.remote | default(item.name) }}"
with_items: "{{ elastic_plugins }}"
when: proxy_env_url is not defined
- name: Install plugins via proxy
command: "/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch --verbose {{ item.remote | default(item.name) }}"
environment:
ES_JAVA_OPTS: "-Dhttp.proxyHost={{ proxy_env_url | urlsplit('hostname') }} -Dhttp.proxyPort={{ proxy_env_url | urlsplit('port') }} -Dhttps.proxyHost={{ proxy_env_url | urlsplit('hostname') }} -Dhttps.proxyPort={{ proxy_env_url | urlsplit('port') }}"
with_items: "{{ elastic_plugins }}"
when: proxy_env_url is defined