mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
junos_linkagg implementation and junos modules refactor (#26587)
* junos_linkagg implementation and junos modules refactor * junos_linkagg implementation * junos_linkagg integration test * net_linkagg integration test for junos * decouple `load_config` and `commit` operations, to allow single commit (in case on confirm commit) and to perform batch commit (multiple `load_config` followed by single `commit`) * Other related refactor * Fix CI issues * Fix unit test failure
This commit is contained in:
parent
82558baaf6
commit
be89ef3eb6
30 changed files with 1140 additions and 220 deletions
|
@ -76,9 +76,10 @@ commands:
|
|||
"""
|
||||
import re
|
||||
|
||||
from ansible.module_utils.junos import junos_argument_spec, check_args
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.connection import exec_command
|
||||
from ansible.module_utils.junos import junos_argument_spec, check_args
|
||||
from ansible.module_utils.junos import commit_configuration, discard_changes
|
||||
from ansible.module_utils.network_common import to_list
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
|
@ -195,11 +196,16 @@ def main():
|
|||
|
||||
if commands:
|
||||
commit = not module.check_mode
|
||||
diff = load_config(module, commands, commit=commit)
|
||||
diff = load_config(module, commands)
|
||||
if diff:
|
||||
if commit:
|
||||
commit_configuration(module)
|
||||
else:
|
||||
discard_changes(module)
|
||||
result['changed'] = True
|
||||
|
||||
if module._diff:
|
||||
result['diff'] = {'prepared': diff}
|
||||
result['changed'] = True
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue