summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-03-25 14:55:51 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit2a60e1e5eef42a1a0f11574d69f3c90be22e52ca (patch)
treebf56971411d00fb8b6391f1140aa2ed2f8d378a1 /lib
parent626945bb33fa0b294100414c058a1f4d2b3e0039 (diff)
downloadpuppet-2a60e1e5eef42a1a0f11574d69f3c90be22e52ca.tar.gz
puppet-2a60e1e5eef42a1a0f11574d69f3c90be22e52ca.tar.xz
puppet-2a60e1e5eef42a1a0f11574d69f3c90be22e52ca.zip
Adding :catalog_terminus setting
This will rarely be used, but it enables even more architectural flexibility, such as precompiling catalogs and storing them in memcached or equivalent. With this setup, a single host can probably serve all catalogs and you would then just have as many compiling hosts as needed. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/application/agent.rb5
-rw-r--r--lib/puppet/configurer.rb12
-rw-r--r--lib/puppet/defaults.rb2
-rw-r--r--lib/puppet/resource/catalog.rb2
4 files changed, 15 insertions, 6 deletions
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index ba203474a..985d87dd0 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -245,7 +245,10 @@ Puppet::Application.new(:agent) do
Puppet::Transaction::Report.terminus_class = :rest
- Puppet::Resource::Catalog.terminus_class = :rest
+ # Override the default; puppetd needs this, usually.
+ # You can still override this on the command-line with, e.g., :compiler.
+ Puppet[:catalog_terminus] = :rest
+
Puppet::Resource::Catalog.cache_class = :yaml
Puppet::Node::Facts.terminus_class = :facter
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb
index 797d93456..0ff87e640 100644
--- a/lib/puppet/configurer.rb
+++ b/lib/puppet/configurer.rb
@@ -94,10 +94,14 @@ class Puppet::Configurer
# Get the remote catalog, yo. Returns nil if no catalog can be found.
def retrieve_catalog
- # This is a bit complicated. We need the serialized and escaped facts,
- # and we need to know which format they're encoded in. Thus, we
- # get a hash with both of these pieces of information.
- fact_options = facts_for_uploading()
+ if Puppet::Resource::Catalog.indirection.terminus_class == :rest
+ # This is a bit complicated. We need the serialized and escaped facts,
+ # and we need to know which format they're encoded in. Thus, we
+ # get a hash with both of these pieces of information.
+ fact_options = facts_for_uploading()
+ else
+ fact_options = {}
+ end
# First try it with no cache, then with the cache.
unless (Puppet[:use_cached_catalog] and result = retrieve_catalog_from_cache(fact_options)) or result = retrieve_new_catalog(fact_options)
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index c67e9efd7..701b785f1 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -149,6 +149,8 @@ module Puppet
huge numbers that can then not be fed back into the system. This is a hackish way to fail in a
slightly more useful way when that happens."],
:node_terminus => ["plain", "Where to find information about nodes."],
+ :catalog_terminus => ["compiler", "Where to get node catalogs. This is useful to change if, for instance,
+ you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store."],
:httplog => { :default => "$logdir/http.log",
:owner => "root",
:mode => 0640,
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index e63c00c62..048920458 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -17,7 +17,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
class DuplicateResourceError < Puppet::Error; end
extend Puppet::Indirector
- indirects :catalog, :terminus_class => :compiler
+ indirects :catalog, :terminus_setting => :catalog_terminus
include Puppet::Util::Tagging
extend Puppet::Util::Pson