Sha256: e2243e0482e20590c0d34cdadec69a053f5529b70674172f3b5680194c9b4ec2
Contents?: true
Size: 696 Bytes
Versions: 39
Compression:
Stored size: 696 Bytes
Contents
require 'facter/util/ip' Facter.add(:arp) do confine :kernel => :linux setcode do output = Facter::Util::Resolution.exec('arp -an') if not output.nil? arp = "" output.each_line do |s| if s =~ /^\S+\s\S+\s\S+\s(\S+)\s\S+\s\S+\s\S+$/ arp = $1.downcase break # stops on the first match end end end "fe:ff:ff:ff:ff:ff" == arp ? arp : nil end end Facter::Util::IP.get_interfaces.each do |interface| Facter.add("arp_" + Facter::Util::IP.alphafy(interface)) do confine :kernel => :linux setcode do arp = Facter::Util::IP.get_arp_value(interface) "fe:ff:ff:ff:ff:ff" == arp ? arp : nil end end end
Version data entries
39 entries across 39 versions & 3 rubygems