Sha256: 15eee9685a8282f38e69602d82b09146785a0981c1f4a7b89bf0bcf0c6ab275b

Contents?: true

Size: 988 Bytes

Versions: 40

Compression:

Stored size: 988 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
      if file =~ /.rb$/
        Puppet.info "Loading downloaded plugin #{file}"
        load file
      else
        Puppet.debug "Skipping downloaded plugin #{file}"
      end
    rescue Exception => detail
      Puppet.err "Could not load downloaded file #{file}: #{detail}"
    end
  end
end

Version data entries

40 entries across 40 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.1.3 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.1.2 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.1.1 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-2.7.26 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.25 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.24 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.23 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.22 lib/puppet/configurer/plugin_handler.rb
puppet-parse-0.1.0 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.0.6 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-2.7.21 lib/puppet/configurer/plugin_handler.rb
puppet-parse-0.0.5 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.0.4 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-parse-0.0.2 lib/vendor/puppet/configurer/plugin_handler.rb
puppet-2.7.20 lib/puppet/configurer/plugin_handler.rb
puppet-2.7.20.rc1 lib/puppet/configurer/plugin_handler.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/configurer/plugin_handler.rb
puppet-2.7.19 lib/puppet/configurer/plugin_handler.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/lib/puppet/configurer/plugin_handler.rb