projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
munin must run ip6 plugin as root as well
[mirror/dsa-puppet.git]
/
facts
/
ipaddresses.rb
diff --git
a/facts/ipaddresses.rb
b/facts/ipaddresses.rb
index
f1bbd69
..
17dbd84
100644
(file)
--- a/
facts/ipaddresses.rb
+++ b/
facts/ipaddresses.rb
@@
-1,4
+1,5
@@
Facter.add("v4ips") do
Facter.add("v4ips") do
+ confine :kernel => :linux
addrs = []
%x{ip addr list}.each do |line|
next unless line =~ /\s+inet/
addrs = []
%x{ip addr list}.each do |line|
next unless line =~ /\s+inet/
@@
-13,6
+14,7
@@
Facter.add("v4ips") do
end
Facter.add("v6ips") do
end
Facter.add("v6ips") do
+ confine :kernel => :linux
addrs = []
%x{ip addr list}.each do |line|
next unless line =~ /\s+inet/
addrs = []
%x{ip addr list}.each do |line|
next unless line =~ /\s+inet/
@@
-21,8
+23,12
@@
Facter.add("v6ips") do
addrs << $1
end
end
addrs << $1
end
end
+ ret = addrs.join(",")
+ if ret.empty?
+ ret = 'no'
+ end
setcode do
setcode do
- addrs.join(",")
+ ret
end
end
end
end