mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
@@ -98,7 +98,7 @@ commands:
|
||||
'''
|
||||
import re
|
||||
|
||||
from ansible.module_utils.nxos import get_config, load_config, run_commands
|
||||
from ansible.module_utils.nxos import load_config, run_commands
|
||||
from ansible.module_utils.nxos import nxos_argument_spec, check_args
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
@@ -190,6 +190,7 @@ def get_vrf(vrf, module):
|
||||
return {}
|
||||
|
||||
parsed_vrf = apply_key_map(vrf_key, vrf_table)
|
||||
parsed_vrf['admin_state'] = parsed_vrf['admin_state'].lower()
|
||||
|
||||
command = 'show run all | section vrf.context.{0}'.format(vrf)
|
||||
body = execute_show_command(command, module)[0]
|
||||
@@ -259,13 +260,13 @@ def main():
|
||||
if proposed.get('vni'):
|
||||
if existing.get('vni') and existing.get('vni') != '':
|
||||
commands.insert(1, 'no vni {0}'.format(existing['vni']))
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True, commands=commands)
|
||||
else:
|
||||
|
||||
if not module.check_mode:
|
||||
load_config(module, commands)
|
||||
results['changed'] = True
|
||||
if 'configure' in commands:
|
||||
commands.pop(0)
|
||||
|
||||
results['changed'] = True
|
||||
if 'configure' in commands:
|
||||
commands.pop(0)
|
||||
|
||||
results['commands'] = commands
|
||||
|
||||
|
||||
Reference in New Issue
Block a user