Sha256: 102f70349f9abcd4781801315963140ad7d4b524703a72c2e9811e32e53b4d80

Contents?: true

Size: 881 Bytes

Versions: 16

Compression:

Stored size: 881 Bytes

Contents

# Break out the code related to plugins.  This module is
# just included into the agent, but having it here makes it
# easier to test.
module Puppet::Configurer::PluginHandler
  def download_plugins?
    Puppet[:pluginsync]
  end

  # Retrieve facts from the central server.
  def download_plugins
    return nil unless download_plugins?
    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)
    return unless FileTest.exist?(file)
    return if FileTest.directory?(file)

    begin
      Puppet.info "Loading downloaded plugin #{file}"
      load file
    rescue Exception => detail
      Puppet.err "Could not load downloaded file #{file}: #{detail}"
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puppet-2.6.18 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.17 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.16 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.15 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.14 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.13 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.12 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.5 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.11 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.4 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.10 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.3 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.1 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.9 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.8 lib/puppet/configurer/plugin_handler.rb
puppet-2.6.7 lib/puppet/configurer/plugin_handler.rb