lib/bolt/applicator.rb in bolt-1.15.0 vs lib/bolt/applicator.rb in bolt-1.16.0
- old
+ new
@@ -2,11 +2,10 @@
require 'base64'
require 'find'
require 'json'
require 'logging'
-require 'minitar'
require 'open3'
require 'bolt/error'
require 'bolt/task'
require 'bolt/apply_result'
require 'bolt/util/puppet_log_level'
@@ -81,19 +80,20 @@
end
end
def compile(target, ast, plan_vars)
trusted = Puppet::Context::TrustedInformation.new('local', target.host, {})
+ facts = @inventory.facts(target).merge('bolt' => true)
catalog_input = {
code_ast: ast,
modulepath: @modulepath,
pdb_config: @pdb_client.config.to_hash,
hiera_config: @hiera_config,
target: {
name: target.host,
- facts: @inventory.facts(target),
+ facts: facts,
variables: @inventory.vars(target).merge(plan_vars),
trusted: trusted.to_h
},
inventory: @inventory.data_hash
}
@@ -223,9 +223,13 @@
@plugin_tarball.value ||
raise(Bolt::Error.new("Failed to pack module plugins: #{@plugin_tarball.reason}", 'bolt/plugin-error'))
end
def build_plugin_tarball
+ # lazy-load expensive gem code
+ require 'minitar'
+ require 'zlib'
+
start_time = Time.now
sio = StringIO.new
output = Minitar::Output.new(Zlib::GzipWriter.new(sio))
Puppet.lookup(:current_environment).override_with(modulepath: @plugin_dirs).modules.each do |mod|