Sha256: bf26b46be674b75035572a42c6242ea7ded03b687263fabcf792b4eedb9eaf3f
Contents?: true
Size: 1013 Bytes
Versions: 3
Compression:
Stored size: 1013 Bytes
Contents
Puppet::Util::FactStore.newstore(:yaml) do desc "Store client facts as flat files, serialized using YAML." # Get a client's facts. def get(node) file = path(node) return nil unless FileTest.exists?(file) begin facts = YAML::load(File.read(file)) rescue => detail Puppet.err "Could not load facts for %s: %s" % [node, detail] end facts end def initialize Puppet.config.use(:yamlfacts) end # Store the facts to disk. def set(node, facts) File.open(path(node), "w", 0600) do |f| begin f.print YAML::dump(facts) rescue => detail Puppet.err "Could not write facts for %s: %s" % [node, detail] end end nil end private # Return the path to a given node's file. def path(node) File.join(Puppet[:yamlfactdir], node + ".yaml") end end # $Id: yaml.rb 2457 2007-05-03 05:24:13Z luke $
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
puppet-0.23.0 | lib/puppet/fact_stores/yaml.rb |
puppet-0.23.2 | lib/puppet/fact_stores/yaml.rb |
puppet-0.23.1 | lib/puppet/fact_stores/yaml.rb |