mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix linux 'ip' stdout parsing. (#16170)
With network-manager in debian (stretch) and openvpn connection enabled the output for ipv6 is different and include a 'peer' keyword. Fixes #15448
This commit is contained in:
parent
2275a08b9a
commit
af150ea43a
1 changed files with 7 additions and 2 deletions
|
@ -2229,8 +2229,13 @@ class LinuxNetwork(Network):
|
|||
if not address.startswith('127.'):
|
||||
ips['all_ipv4_addresses'].append(address)
|
||||
elif words[0] == 'inet6':
|
||||
address, prefix = words[1].split('/')
|
||||
scope = words[3]
|
||||
if 'peer' == words[2]:
|
||||
address = words[1]
|
||||
_, prefix = words[3].split('/')
|
||||
scope = words[5]
|
||||
else:
|
||||
address, prefix = words[1].split('/')
|
||||
scope = words[3]
|
||||
if 'ipv6' not in interfaces[device]:
|
||||
interfaces[device]['ipv6'] = []
|
||||
interfaces[device]['ipv6'].append({
|
||||
|
|
Loading…
Reference in a new issue