puppet版本:3.6.1

puppetmaster上执行facter的时候,总是有提示:

Could not retrieve fact='arp_eth0', resolution='': undefined method `get_arp_value' for Facter::Util::IP:Module


解决办法:vim /usr/lib/ruby/site_ruby/1.8/facter/util/ip.rb

#加入以下内容:


def self.get_arp_value(interface)
    arp = Facter::Util::Resolution.exec("arp -en -i #{interface} | sed -e 1d")
    if arp =~ /^\S+\s+\w+\s+(\S+)\s+\w\s+\S+$/
     return $1
    end
  end

重启puppetmaster.再次执行facter,问题解决!