1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Nathaniel Case 2017-07-17 11:15:43 -04:00 committed by GitHub
parent 855544604a
commit a3aa5d799e

View file

@ -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'])
)