2 # This is a class that gives access to the configured fact provider
3 # such as MCollectives::Facts::Facter that uses Reductive Labs facter
5 # The actual provider is pluggable and configurable using the 'factsource'
6 # configuration option.
8 # To develop a new factsource simply create a class under MCollective::Facts::
9 # and provide the following classes:
12 # self.has_fact?(fact)
14 # You can also just inherit from MCollective::Facts::Base and provide just the
18 # method that should return a hash of facts.
20 autoload :Base, "mcollective/facts/base"
24 # True if we know of a specific fact else false
25 def self.has_fact?(fact, value)
26 PluginManager["facts_plugin"].get_fact(fact) == value ? true : false
29 # Get the value of a fact
30 def self.get_fact(fact)
31 PluginManager["facts_plugin"].get_fact(fact)
34 # Get the value of a fact
36 PluginManager["facts_plugin"].get_fact(fact)