Signed-off-by: Stephen Gran <steve@lobefin.net>
end
end
+Facter.add("v4ips") do
+ confine :kernel => %w{FreeBSD}
+ setcode do
+ addrs = []
+ output = %x{/sbin/ifconfig}
+
+ output.split(/^\S/).each { |str|
+ if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/
+ tmp = $1
+ unless tmp =~ /127\./
+ addrs << tmp
+ break
+ end
+ end
+ }
+
+ ret = addrs.join(",")
+ if ret.empty?
+ ret = 'no'
+ end
+ ret
+ end
+end
+
Facter.add("v6ips") do
confine :kernel => :linux
addrs = []