mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 16:06:43 +00:00
Fix nxos_system name-server parsing (#25973)
* Fix nxos_system name-server parsing * Introduce lookup_source as a noop, but don't advertise its use
This commit is contained in:
@@ -87,10 +87,6 @@ EXAMPLES = """
|
||||
nxos_system:
|
||||
state: absent
|
||||
|
||||
- name: configure DNS lookup sources
|
||||
nxos_system:
|
||||
lookup_source: Management1
|
||||
|
||||
- name: configure name servers
|
||||
nxos_system:
|
||||
name_servers:
|
||||
@@ -251,8 +247,9 @@ def parse_name_servers(config, vrf_config):
|
||||
objects.append({'server': addr, 'vrf': None})
|
||||
|
||||
for vrf, cfg in iteritems(vrf_config):
|
||||
for item in re.findall('ip name-server (\S+)', cfg, re.M):
|
||||
for addr in match.group(1).split(' '):
|
||||
vrf_match = re.search('ip name-server (.+)', cfg, re.M)
|
||||
if vrf_match:
|
||||
for addr in vrf_match.group(1).split(' '):
|
||||
objects.append({'server': addr, 'vrf': vrf})
|
||||
|
||||
return objects
|
||||
@@ -334,7 +331,7 @@ def main():
|
||||
name_servers=dict(type='list'),
|
||||
|
||||
system_mtu=dict(type='int'),
|
||||
|
||||
lookup_source=dict(),
|
||||
state=dict(default='present', choices=['present', 'absent'])
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user