undefined method `get_arp_value' for Facter::Util::IP:Module

puppet版本:3.6.1

puppetmaster上執行facter的時候,總是有提示:

Could not retrieve fact='arp_eth0', resolution='<anonymous>': 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,問題解決!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章