summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-03-24 00:04:47 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit9fbb69f9d4de0e618954bc18b7501e300317022a (patch)
treeeb9ef70beb3e9938391b1bfd4d1ed4864d44c291 /lib
parent7e1e76e91579a49c07aa5cb5917a9800d59b8137 (diff)
downloadpuppet-9fbb69f9d4de0e618954bc18b7501e300317022a.tar.gz
puppet-9fbb69f9d4de0e618954bc18b7501e300317022a.tar.xz
puppet-9fbb69f9d4de0e618954bc18b7501e300317022a.zip
Adding support for only using cached catalogs
This basically allows a sysadmin to control when a client will compile a new catalog - with this option enabled, the client will use the cached catalog as long as it has one, only recompiling when run with the option disabled. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/configurer.rb2
-rw-r--r--lib/puppet/defaults.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb
index 3b4f9ec90..797d93456 100644
--- a/lib/puppet/configurer.rb
+++ b/lib/puppet/configurer.rb
@@ -100,7 +100,7 @@ class Puppet::Configurer
fact_options = facts_for_uploading()
# First try it with no cache, then with the cache.
- unless result = retrieve_new_catalog(fact_options)
+ unless (Puppet[:use_cached_catalog] and result = retrieve_catalog_from_cache(fact_options)) or result = retrieve_new_catalog(fact_options)
if ! Puppet[:usecacheonfailure]
Puppet.warning "Not using cache on failed catalog"
return nil
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 2f397f495..c67e9efd7 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -561,6 +561,10 @@ module Puppet
new configurations, where you want to fix the broken configuration
rather than reverting to a known-good one."
],
+ :use_cached_catalog => [false,
+ "Whether to only use the cached catalog rather than compiling a new catalog
+ on every run. Puppet can be run with this enabled by default and then selectively
+ disabled when a recompile is desired."],
:ignorecache => [false,
"Ignore cache and always recompile the configuration. This is
useful for testing new configurations, where the local cache may in