# File lib/puppet/configurer/downloader.rb, line 29 def catalog catalog = Puppet::Resource::Catalog.new("PluginSync", @environment) catalog.host_config = false catalog.add_resource(file) catalog end
Evaluate our download, returning the list of changed values.
# File lib/puppet/configurer/downloader.rb, line 8 def evaluate Puppet.info "Retrieving #{name}" files = [] begin catalog.apply do |trans| trans.changed?.each do |resource| yield resource if block_given? files << resource[:path] end end rescue Puppet::Error => detail Puppet.log_exception(detail, "Could not retrieve #{name}: #{detail}") end files end
# File lib/puppet/configurer/downloader.rb, line 36 def file args = default_arguments.merge(:path => path, :source => source) args[:ignore] = ignore.split if ignore Puppet::Type.type(:file).new(args) end
# File lib/puppet/configurer/downloader.rb, line 25 def initialize(name, path, source, ignore = nil, environment = nil, source_permissions = :ignore) @name, @path, @source, @ignore, @environment, @source_permissions = name, path, source, ignore, environment, source_permissions end