diff --git a/lib/bolt/applicator.rb b/lib/bolt/applicator.rb index eaf4d0da0e..f832fc6843 100644 --- a/lib/bolt/applicator.rb +++ b/lib/bolt/applicator.rb @@ -264,7 +264,7 @@ def apply_ast(raw_ast, targets, options, plan_vars = {}) result_promises = targets.zip(futures).flat_map do |target, future| @executor.queue_execute([target]) do |transport, batch| - @executor.with_node_logging("Applying manifest block", batch) do + @executor.with_node_logging("Applying manifest block%s" % (" (with agent confdir)" if options[:agent]), batch) do catalog = future.value if future.rejected? batch.map do |batch_target| @@ -285,7 +285,8 @@ def apply_ast(raw_ast, targets, options, plan_vars = {}) 'plugins' => Puppet::Pops::Types::PSensitiveType::Sensitive.new(plugins), 'apply_settings' => @apply_settings, '_task' => catalog_apply_task.name, - '_noop' => options[:noop] + '_noop' => options[:noop], + '_agent' => options[:agent] } callback = proc do |event| diff --git a/libexec/apply_catalog.rb b/libexec/apply_catalog.rb index ccf6d62232..7542bae0b5 100755 --- a/libexec/apply_catalog.rb +++ b/libexec/apply_catalog.rb @@ -17,9 +17,9 @@ puppet_root = Dir.mktmpdir moduledir = File.join(puppet_root, 'modules') Dir.mkdir(moduledir) -cli = (Puppet::Settings::REQUIRED_APP_SETTINGS + [:rundir]).flat_map do |setting| - ["--#{setting}", File.join(puppet_root, setting.to_s.chomp('dir'))] -end +cli = (Puppet::Settings::REQUIRED_APP_SETTINGS + [:rundir]).filter_map do |setting| + ["--#{setting}", File.join(puppet_root, setting.to_s.chomp('dir'))] unless (args['_agent'] && setting == :confdir) +end.flatten cli << '--modulepath' << moduledir Puppet.initialize_settings(cli)