mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
elasticsearch_plugin: add check mode support (#3043)
This commit is contained in:
committed by
Matt Clay
parent
b69fb8a1ca
commit
b09291be2c
@@ -142,7 +142,10 @@ def install_plugin(module, plugin_bin, plugin_name, version, url, proxy_host, pr
|
||||
|
||||
cmd = " ".join(cmd_args)
|
||||
|
||||
rc, out, err = module.run_command(cmd)
|
||||
if module.check_mode:
|
||||
rc, out, err = 0, "check mode", ""
|
||||
else:
|
||||
rc, out, err = module.run_command(cmd)
|
||||
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
@@ -155,7 +158,10 @@ def remove_plugin(module, plugin_bin, plugin_name):
|
||||
|
||||
cmd = " ".join(cmd_args)
|
||||
|
||||
rc, out, err = module.run_command(cmd)
|
||||
if module.check_mode:
|
||||
rc, out, err = 0, "check mode", ""
|
||||
else:
|
||||
rc, out, err = module.run_command(cmd)
|
||||
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
@@ -175,7 +181,8 @@ def main():
|
||||
proxy_host=dict(default=None),
|
||||
proxy_port=dict(default=None),
|
||||
version=dict(default=None)
|
||||
)
|
||||
),
|
||||
supports_check_mode=True
|
||||
)
|
||||
|
||||
name = module.params["name"]
|
||||
|
||||
Reference in New Issue
Block a user