diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-03-15 16:13:15 -0700 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-03-15 23:48:08 -0700 |
commit | 852fb9744320c253772c85e52b262b0290fb7dd4 (patch) | |
tree | 9d3cef147e874cfb9857e6fc6290c7cf7a16b3f1 /lib/puppet/configurer | |
parent | a6d0e99e97d18b622793a807e985580cb65a8c7c (diff) | |
download | puppet-852fb9744320c253772c85e52b262b0290fb7dd4.tar.gz puppet-852fb9744320c253772c85e52b262b0290fb7dd4.tar.xz puppet-852fb9744320c253772c85e52b262b0290fb7dd4.zip |
(#5073) Download plugins even if you're filtering on tags
When we eval a resource in transaction.rb it was being skipped when
filtering on tags and downloading the plugins. There's a lot of
complicated conditions for whether to skip a resource, but this is a
condensed version of the path that was causing plugins not to be
downloaded.
skip?
missing_tags?
!ignore_tags?
!host_config
The Puppet::Configurer::Downloader creates separate catalogs and applies them
to get custom facts and plugins, so should be setting host_config to false.
Puppet::Util::Settings also sets host_config to false when you call use on
settings, while normal catalog application defaults to true.
Thanks to Stefan Schulte <stefan.schulte@taunusstein.net> for suggesting
the implementation fix.
Diffstat (limited to 'lib/puppet/configurer')
-rw-r--r-- | lib/puppet/configurer/downloader.rb | 1 | ||||
-rw-r--r-- | lib/puppet/configurer/plugin_handler.rb | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb index 1b587ed4b..b3696201a 100644 --- a/lib/puppet/configurer/downloader.rb +++ b/lib/puppet/configurer/downloader.rb @@ -50,6 +50,7 @@ class Puppet::Configurer::Downloader def catalog catalog = Puppet::Resource::Catalog.new + catalog.host_config = false catalog.add_resource(file) catalog end diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index cfc6b5a0b..ae088f26f 100644 --- a/lib/puppet/configurer/plugin_handler.rb +++ b/lib/puppet/configurer/plugin_handler.rb @@ -9,7 +9,14 @@ module Puppet::Configurer::PluginHandler # Retrieve facts from the central server. def download_plugins return nil unless download_plugins? - Puppet::Configurer::Downloader.new("plugin", Puppet[:plugindest], Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) } + plugin_downloader = Puppet::Configurer::Downloader.new( + "plugin", + Puppet[:plugindest], + Puppet[:pluginsource], + Puppet[:pluginsignore] + ) + + plugin_downloader.evaluate.each { |file| load_plugin(file) } end def load_plugin(file) |