Merge pull request #60 from barryib/add-proxy-for-plugins-installation

Define a proxy for plugin installation
This commit is contained in:
gingerwizard 2016-03-21 21:57:59 +00:00
commit 3c5adf9961
3 changed files with 34 additions and 3 deletions

View file

@ -3,6 +3,9 @@
- fail: msg="es_instance_name must be specified and cannot be blank"
when: es_instance_name is not defined or es_instance_name == ''
- fail: msg="es_proxy_port must be specified and cannot be blank when es_proxy_host is defined"
when: (es_proxy_port is not defined or es_proxy_port == '') and (es_proxy_host is defined and es_proxy_host != '')
- set_fact: multi_cast={{ (es_version | version_compare('2.0', '<') and es_config['discovery.zen.ping.multicast.enabled'] is not defined) or (es_config['discovery.zen.ping.multicast.enabled'] is defined and es_config['discovery.zen.ping.multicast.enabled'])}}
- debug: msg="WARNING - It is recommended you specify the parameter 'http.port' when multicast is disabled"

View file

@ -30,7 +30,15 @@
- name: Install elasticsearch plugins
#debug: var=item
command: "{{es_home}}/bin/plugin install {{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %} --silent"
command: >
{{es_home}}/bin/plugin install
{{ item.plugin }}{% if item.version is defined and item.version != '' %}/{{ item.version }}{% endif %}
{% if item.proxy_host is defined and item.proxy_host != '' and item.proxy_port is defined and item.proxy_port != ''%}
-DproxyHost={{ item.proxy_host }} -DproxyPort={{ item.proxy_port }}
{% elif es_proxy_host is defined and es_proxy_host != '' %}
-DproxyHost={{ es_proxy_host }} -DproxyPort={{ es_proxy_port }}
{% endif %}
--silent
register: plugin_installed
failed_when: "'Failed to install' in plugin_installed.stderr"
changed_when: plugin_installed.rc == 0