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,6 +2229,11 @@ class LinuxNetwork(Network):
|
|||
if not address.startswith('127.'):
|
||||
ips['all_ipv4_addresses'].append(address)
|
||||
elif words[0] == 'inet6':
|
||||
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]:
|
||||
|
|
Loading…
Reference in a new issue