diff options
-rw-r--r-- | lib/facter/ipaddress.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb index 5260504..e8b2c38 100644 --- a/lib/facter/ipaddress.rb +++ b/lib/facter/ipaddress.rb @@ -26,10 +26,10 @@ Facter.add(:ipaddress) do confine :kernel => :linux setcode do ip = nil - output = %x{/sbin/ifconfig} + output = %x{/sbin/ip addr show} output.split(/^\S/).each { |str| - if str =~ /inet addr:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ + if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 unless tmp =~ /^127\./ ip = tmp |