Merge pull request #1572 from barryib/elasticsearch_plugin_add_proxy_support

Elasticsearch: Add proxy support for plugin installation
reviewable/pr18780/r1
Matt Davis 9 years ago
commit 8293068078

@ -61,6 +61,16 @@ options:
- Your configured plugin directory specified in Elasticsearch - Your configured plugin directory specified in Elasticsearch
required: False required: False
default: /usr/share/elasticsearch/plugins/ default: /usr/share/elasticsearch/plugins/
proxy_host:
description:
- Proxy host to use during plugin installation
required: False
default: None
proxy_port:
description:
- Proxy port to use during plugin installation
required: False
default: None
version: version:
description: description:
- Version of the plugin to be installed. - Version of the plugin to be installed.
@ -124,16 +134,20 @@ def main():
timeout=dict(default="1m"), timeout=dict(default="1m"),
plugin_bin=dict(default="/usr/share/elasticsearch/bin/plugin"), plugin_bin=dict(default="/usr/share/elasticsearch/bin/plugin"),
plugin_dir=dict(default="/usr/share/elasticsearch/plugins/"), plugin_dir=dict(default="/usr/share/elasticsearch/plugins/"),
proxy_host=dict(default=None),
proxy_port=dict(default=None),
version=dict(default=None) version=dict(default=None)
) )
) )
plugin_bin = module.params["plugin_bin"]
plugin_dir = module.params["plugin_dir"]
name = module.params["name"] name = module.params["name"]
state = module.params["state"] state = module.params["state"]
url = module.params["url"] url = module.params["url"]
timeout = module.params["timeout"] timeout = module.params["timeout"]
plugin_bin = module.params["plugin_bin"]
plugin_dir = module.params["plugin_dir"]
proxy_host = module.params["proxy_host"]
proxy_port = module.params["proxy_port"]
version = module.params["version"] version = module.params["version"]
present = is_plugin_present(parse_plugin_repo(name), plugin_dir) present = is_plugin_present(parse_plugin_repo(name), plugin_dir)
@ -147,6 +161,9 @@ def main():
cmd_args = [plugin_bin, package_state_map[state], name] cmd_args = [plugin_bin, package_state_map[state], name]
if proxy_host and proxy_port:
cmd_args.append("-DproxyHost=%s -DproxyPort=%s" % proxy_host, proxy_port)
if url: if url:
cmd_args.append("--url %s" % url) cmd_args.append("--url %s" % url)

Loading…
Cancel
Save