Created
September 18, 2013 11:16
-
-
Save dalen/6607716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"lib/puppet/indirector/facts/ohaifacter.rb" 14L, 544C | |
require 'puppet/node/facts' | |
require 'puppet/indirector/code' | |
class Puppet::Node::Facts::Ohaifacter < Puppet::Indirector::Code | |
desc "Retrieve facts from Ohai and Facter. | |
Merges facts from both facts terminii preferring Ohai facts if there is a conflict." | |
# Look up a host's facts | |
def find(request) | |
facter = Puppet::Node::Facts.indirection.terminus(:facter).find(request) | |
ohai = Puppet::Node::Facts.indirection.terminus(:ohai).find(request) | |
Puppet::Node::Facts.new(request.key, facter.values.merge(ohai.values)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment