mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
* Fixes #24251 save config only if it is changed Save to startup configuration only when it is different from running configuration. * Fix unit test issue
This commit is contained in:
parent
c6533d4da9
commit
f5d865a208
3 changed files with 10 additions and 5 deletions
|
@ -331,8 +331,10 @@ def main():
|
|||
|
||||
if module.params['save']:
|
||||
if not module.check_mode:
|
||||
run_commands(module, ['copy running-config startup-config'])
|
||||
result['changed'] = True
|
||||
response = run_commands(module, ['show running-config diffs'])
|
||||
if len(response[0]):
|
||||
run_commands(module, ['copy running-config startup-config'])
|
||||
result['changed'] = True
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
|
|
@ -382,8 +382,10 @@ def main():
|
|||
|
||||
if module.params['save']:
|
||||
if not module.check_mode:
|
||||
run_commands(module, ['copy running-config startup-config\r'])
|
||||
result['changed'] = True
|
||||
response = run_commands(module, ['show archive config differences'])
|
||||
if response[0].find('!No changes were found') < 0:
|
||||
run_commands(module, ['copy running-config startup-config\r'])
|
||||
result['changed'] = True
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue