1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

facts: correctly detect multiple ipv6 addresses per device (#50020)

Fixes #49473
This commit is contained in:
Martin Krizek 2018-12-18 21:49:28 +01:00 committed by Jordan Borean
parent 6b41588e93
commit 29c3bb48e9
2 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Correctly detect multiple ipv6 addresses per device in facts (https://github.com/ansible/ansible/issues/49473)

View file

@ -237,11 +237,11 @@ class LinuxNetwork(Network):
scope = words[3] scope = words[3]
if 'ipv6' not in interfaces[device]: if 'ipv6' not in interfaces[device]:
interfaces[device]['ipv6'] = [] interfaces[device]['ipv6'] = []
interfaces[device]['ipv6'].append({ interfaces[device]['ipv6'].append({
'address': address, 'address': address,
'prefix': prefix, 'prefix': prefix,
'scope': scope 'scope': scope
}) })
# If this is the default address, update default_ipv6 # If this is the default address, update default_ipv6
if 'address' in default_ipv6 and default_ipv6['address'] == address: if 'address' in default_ipv6 and default_ipv6['address'] == address:
default_ipv6['prefix'] = prefix default_ipv6['prefix'] = prefix