From d393409fed203bcd9a581b5ae5473b2d196525a3 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 5 Nov 2016 15:58:06 +0100 Subject: [PATCH] Fix type detection on OpenSolaris for loopback interface Extract of ifconfig output: # ifconfig -a lo0: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 rtls0: flags=1004843 mtu 1500 index 3 inet 192.168.125.125 netmask ffffff00 broadcast 192.168.125.255 ether 0:20:91:83:45:82 --- lib/ansible/module_utils/facts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 58c5103283..211c337086 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -3026,6 +3026,8 @@ class SunOSNetwork(GenericBsdIfconfigNetwork): v = 'ipv4' if 'IPv6' in flags: v = 'ipv6' + if 'LOOPBACK' in flags: + current_if['type'] = 'loopback' current_if[v].append({'flags': flags, 'mtu': words[3]}) current_if['macaddress'] = 'unknown' # will be overwritten later return current_if