From b06123e986643fad7aa9f8aedd182d8ccb927e9d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 20 Sep 2016 11:42:51 -0400 Subject: [PATCH] fixes junos_config to be idempotent when confirming a commit (#4946) The junos_config module would always return true when confirming a commit This changes the module to now check first making the feature idempontent --- lib/ansible/modules/network/junos/junos_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/junos/junos_config.py b/lib/ansible/modules/network/junos/junos_config.py index eeeb55c24b..b1be8d3a94 100644 --- a/lib/ansible/modules/network/junos/junos_config.py +++ b/lib/ansible/modules/network/junos/junos_config.py @@ -231,9 +231,8 @@ def zeroize_config(module, result): result['changed'] = True def confirm_config(module, result): - if not module.check_mode: - module.connection.commit_config() - result['changed'] = True + checkonly = module.check_mode + result['changed'] = module.connection.confirm_commit(checkonly) def run(module, result): if module.params['rollback']: