summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-05-16 15:42:20 -0500
committerLuke Kanies <luke@madstop.com>2008-05-16 15:42:20 -0500
commit8008bbc447764e0ca28169284f4d6df3a86dcdd6 (patch)
treef4f8a09b0b4ffcfac8f9196c9977fbcb21b6cece /lib/puppet
parenta02c6bbe7ccac05593c9e07e9f0215ab6ceda8ad (diff)
downloadpuppet-8008bbc447764e0ca28169284f4d6df3a86dcdd6.tar.gz
puppet-8008bbc447764e0ca28169284f4d6df3a86dcdd6.tar.xz
puppet-8008bbc447764e0ca28169284f4d6df3a86dcdd6.zip
Modified the 'factpath' setting to automatically configure
Facter to load facts there if a new enough version of Facter is used.
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/defaults.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index df2fb9425..57299b7e7 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -505,9 +505,11 @@ module Puppet
# Central fact information.
self.setdefaults(:main,
- :factpath => ["$vardir/facts",
- "Where Puppet should look for facts. Multiple directories should
- be colon-separated, like normal PATH variables."],
+ :factpath => {:default => "$vardir/facts",
+ :desc => "Where Puppet should look for facts. Multiple directories should
+ be colon-separated, like normal PATH variables.",
+ :call_on_define => true, # Call our hook with the default value, so we always get the value added to facter.
+ :hook => proc { |value| Facter.search(value) if Facter.respond_to?(:search) }},
:factdest => ["$vardir/facts",
"Where Puppet should store facts that it pulls down from the central
server."],