mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
cf00883c9d
commit
1b66a13186
3 changed files with 14 additions and 14 deletions
|
@ -215,7 +215,8 @@ def map_config_to_obj(module, warnings):
|
||||||
if "Interface does not exist" in command_result[0]:
|
if "Interface does not exist" in command_result[0]:
|
||||||
warnings.append("Could not gather switchport information for {0}: {1}".format(item, command_result[0]))
|
warnings.append("Could not gather switchport information for {0}: {1}".format(item, command_result[0]))
|
||||||
continue
|
continue
|
||||||
elif command_result[0] != "":
|
|
||||||
|
if command_result[0]:
|
||||||
switchport_cfg = command_result[0].split(':')[1].strip()
|
switchport_cfg = command_result[0].split(':')[1].strip()
|
||||||
|
|
||||||
if switchport_cfg == 'Enabled':
|
if switchport_cfg == 'Enabled':
|
||||||
|
@ -226,11 +227,10 @@ def map_config_to_obj(module, warnings):
|
||||||
obj = {
|
obj = {
|
||||||
'name': item.lower(),
|
'name': item.lower(),
|
||||||
'state': state,
|
'state': state,
|
||||||
|
'access_vlan': parse_config_argument(configobj, item, 'switchport access vlan'),
|
||||||
|
'native_vlan': parse_config_argument(configobj, item, 'switchport trunk native vlan'),
|
||||||
|
'trunk_allowed_vlans': parse_config_argument(configobj, item, 'switchport trunk allowed vlan'),
|
||||||
}
|
}
|
||||||
|
|
||||||
obj['access_vlan'] = parse_config_argument(configobj, item, 'switchport access vlan')
|
|
||||||
obj['native_vlan'] = parse_config_argument(configobj, item, 'switchport trunk native vlan')
|
|
||||||
obj['trunk_allowed_vlans'] = parse_config_argument(configobj, item, 'switchport trunk allowed vlan')
|
|
||||||
if obj['access_vlan']:
|
if obj['access_vlan']:
|
||||||
obj['mode'] = 'access'
|
obj['mode'] = 'access'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- debug:
|
- debug:
|
||||||
msg: "START eos_l3_interface/cli/no_interface.yaml on connection={{ ansible_connection }}"
|
msg: "START eos_l2_interface/cli/no_interface.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: Create fake interface
|
- name: Create fake interface
|
||||||
eos_interface:
|
eos_interface:
|
||||||
|
@ -33,4 +33,4 @@
|
||||||
that: "result.warnings is not defined"
|
that: "result.warnings is not defined"
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "END eos_l3_interface/cli/no_interface.yaml on connection={{ ansible_connection }}"
|
msg: "END eos_l2_interface/cli/no_interface.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- debug:
|
- debug:
|
||||||
msg: "START eos_l3_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"
|
msg: "START eos_l2_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: Create fake interface
|
- name: Create fake interface
|
||||||
eos_interface:
|
eos_interface:
|
||||||
|
@ -34,4 +34,4 @@
|
||||||
that: "result.warnings is not defined"
|
that: "result.warnings is not defined"
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "END eos_l3_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"
|
msg: "END eos_l2_interface/eapi/no_interface.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
Loading…
Reference in a new issue