diff options
author | Luke Kanies <luke@madstop.com> | 2007-09-25 16:01:07 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-09-25 16:01:07 -0500 |
commit | fa643e61c7451c2c46623d2c801a42c6c7640e1e (patch) | |
tree | 05128cedf0e7010c2c8b9c6f3ae4104e1332ad1c /lib/puppet/indirector/code | |
parent | 938b91894d09ea804d2fc9eaac57b52f46de793a (diff) | |
download | puppet-fa643e61c7451c2c46623d2c801a42c6c7640e1e.tar.gz puppet-fa643e61c7451c2c46623d2c801a42c6c7640e1e.tar.xz puppet-fa643e61c7451c2c46623d2c801a42c6c7640e1e.zip |
Adding more indirection termini, mostly focused on caching
information in yaml.
Diffstat (limited to 'lib/puppet/indirector/code')
-rw-r--r-- | lib/puppet/indirector/code/facts.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/puppet/indirector/code/facts.rb b/lib/puppet/indirector/code/facts.rb new file mode 100644 index 000000000..b64e9854e --- /dev/null +++ b/lib/puppet/indirector/code/facts.rb @@ -0,0 +1,21 @@ +require 'puppet/node/facts' +require 'puppet/indirector/code' + +class Puppet::Indirector::Code::Facts < Puppet::Indirector::Code + desc "Retrieve facts from Facter. This provides a somewhat abstract interface + between Puppet and Facter. It's only 'somewhat' abstract because it always + returns the local host's facts, regardless of what you attempt to find." + + def destroy(facts) + raise Puppet::DevError, "You cannot destroy facts in the code store; it is only used for getting facts from Facter" + end + + # Look a host's facts up in Facter. + def find(key) + Puppet::Node::Facts.new(key, Facter.to_hash) + end + + def save(facts) + raise Puppet::DevError, "You cannot save facts to the code store; it is only used for getting facts from Facter" + end +end |