mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Run save
inside config mode. (#23977)
* Run `save` before exiting config mode. * Fix unit tests for `save` * Allow `save` to be on its own again and introspect success * Introspecting `compare running` makes this a lot harder. Move `save` tests to integration tests
This commit is contained in:
parent
9c4daded94
commit
fc0bf87c20
3 changed files with 65 additions and 12 deletions
|
@ -269,9 +269,11 @@ def main():
|
|||
run(module, result)
|
||||
|
||||
if module.params['save']:
|
||||
if not module.check_mode:
|
||||
run_commands(module, ['save'])
|
||||
result['changed'] = True
|
||||
diff = run_commands(module, commands=['configure', 'compare saved'])[1]
|
||||
if diff != '[edit]':
|
||||
run_commands(module, commands=['save'])
|
||||
result['changed'] = True
|
||||
run_commands(module, commands=['exit'])
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue