Class MCollective::Facts::Yaml
In: plugins/mcollective/facts/yaml.rb
Parent: Base

A factsource that reads a hash of facts from a YAML file

Multiple files can be specified seperated with a : in the config file, they will be merged with later files overriding earlier ones in the list.

Methods

get_facts  

Public Instance methods

[Source]

    # File plugins/mcollective/facts/yaml.rb, line 11
11:             def get_facts
12:                 config = Config.instance
13: 
14:                 fact_files = config.pluginconf["yaml"].split(":")
15:                 facts = {}
16: 
17:                 fact_files.each do |file|
18:                     if File.exist?(file)
19:                         facts.merge!(YAML.load_file(file))
20:                     else
21:                         Log.instance.error("Can't find YAML file to load: #{file}")
22:                     end
23:                 end
24: 
25:                 facts
26:             end

[Validate]