From 84e5bb7da5cbafdd64325d26d57abc9bcf79b2dc Mon Sep 17 00:00:00 2001 From: AngusWarren Date: Thu, 30 Jul 2020 04:32:16 +0800 Subject: Prevent vyos_config from saving in check mode. (#53) Prevent vyos_config from saving in check mode. Reviewed-by: https://github.com/apps/ansible-zuul --- plugins/modules/vyos_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 893cd647..5e4836d8 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -349,7 +349,8 @@ def main(): if module.params["save"]: diff = run_commands(module, commands=["configure", "compare saved"])[1] if diff != "[edit]": - run_commands(module, commands=["save"]) + if not module.check_mode: + run_commands(module, commands=["save"]) result["changed"] = True run_commands(module, commands=["exit"]) -- cgit v1.2.3