mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix ios_config broken logic
This commit is contained in:
parent
6ad7d6b3cd
commit
36ba105b91
1 changed files with 3 additions and 5 deletions
|
@ -193,7 +193,7 @@ responses:
|
||||||
sample: ['...', '...']
|
sample: ['...', '...']
|
||||||
"""
|
"""
|
||||||
from ansible.module_utils.netcfg import NetworkConfig, dumps
|
from ansible.module_utils.netcfg import NetworkConfig, dumps
|
||||||
from ansible.module_utils.ios import NetworkModule
|
from ansible.module_utils.network import NetworkModule
|
||||||
from ansible.module_utils.ios import load_config, get_config, ios_argument_spec
|
from ansible.module_utils.ios import load_config, get_config, ios_argument_spec
|
||||||
|
|
||||||
def invoke(name, *args, **kwargs):
|
def invoke(name, *args, **kwargs):
|
||||||
|
@ -271,9 +271,10 @@ def main():
|
||||||
commands = list()
|
commands = list()
|
||||||
if configobjs:
|
if configobjs:
|
||||||
commands = dumps(configobjs, 'commands')
|
commands = dumps(configobjs, 'commands')
|
||||||
|
commands = commands.split('\n')
|
||||||
|
|
||||||
if module.params['before']:
|
if module.params['before']:
|
||||||
commands[:0] = before
|
commands[:0] = module.params['before']
|
||||||
|
|
||||||
if module.params['after']:
|
if module.params['after']:
|
||||||
commands.extend(module.params['after'])
|
commands.extend(module.params['after'])
|
||||||
|
@ -284,9 +285,6 @@ def main():
|
||||||
|
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
|
|
||||||
if commands:
|
|
||||||
commands = commands.split('\n')
|
|
||||||
|
|
||||||
result['updates'] = commands
|
result['updates'] = commands
|
||||||
result['connected'] = module.connected
|
result['connected'] = module.connected
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue