]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - facts/ipaddresses.rb
match subnets that might exist
[dsa-puppet.git] / facts / ipaddresses.rb
index 17dbd84aeb5f349001524fc1fdf28e2d50f27033..d03bbbc4ead3583fd90d311f02b83d6255a91039 100644 (file)
@@ -4,7 +4,7 @@ Facter.add("v4ips") do
         %x{ip addr list}.each do |line|
                 next unless line =~ /\s+inet/
                 next if line =~ /scope (link|host)/
-                if line =~ /\s+inet\s+(\S+)\/\d\d .*/
+                if line =~ /\s+inet\s+(\S+)\/\d{1,2} .*/
                         addrs << $1
                 end
         end
@@ -19,7 +19,7 @@ Facter.add("v6ips") do
         %x{ip addr list}.each do |line|
                 next unless line =~ /\s+inet/
                 next if line =~ /scope (link|host)/
-                if line =~ /\s+inet6\s+(\S+)\/\d\d .*/
+                if line =~ /\s+inet6\s+(\S+)\/\d{1,3} .*/
                         addrs << $1
                 end
         end