Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/beaker/task_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def puppet_version
'root'
end

BOLT_VERSION = '0.7.0'.freeze
BOLT_VERSION = '0.16.1'.freeze

def install_bolt_on(hosts, version = BOLT_VERSION, source = nil)
unless default[:docker_image_commands].nil?
Expand Down Expand Up @@ -73,7 +73,14 @@ def run_bolt_task(task_name:, params: nil, password: DEFAULT_PASSWORD, host: 'lo
bolt_path = '/opt/puppetlabs/puppet/bin/bolt'
module_path = '/etc/puppetlabs/code/modules'
end
bolt_full_cli = "#{bolt_path} task run #{task_name} --insecure -m #{module_path} --nodes #{host} --password #{password}" # rubocop:disable Metrics/LineLength

if Puppet::Util::Package.versioncmp(BOLT_VERSION, '0.15.0') > 0
check = '--no-host-key-check'
else
check = '--insecure'
end

bolt_full_cli = "#{bolt_path} task run #{task_name} #{check} -m #{module_path} --nodes #{host} --password #{password}" # rubocop:disable Metrics/LineLength
bolt_full_cli << if params.class == Hash
" --params '#{params.to_json}'"
else
Expand Down