tasks/ci.rake in beaker-puppet-1.18.10 vs tasks/ci.rake in beaker-puppet-1.18.11
- old
+ new
@@ -137,11 +137,11 @@
ENV['TESTS'] ||= ENV['TEST']
ENV['TESTS'] ||= 'tests'
end
end
- task :gen_hosts do
+ task :gen_hosts, [:hypervisor] do |t, args|
hosts =
if ENV['HOSTS']
ENV['HOSTS']
elsif ENV['BEAKER_HOSTS']
ENV['BEAKER_HOSTS']
@@ -160,10 +160,18 @@
if File.exists?(hosts)
ENV['HOSTS'] = hosts
else
hosts_file = "tmp/#{hosts}-#{SecureRandom.uuid}.yaml"
- cli = BeakerHostGenerator::CLI.new([hosts, '--disable-default-role', '--osinfo-version', '1'])
+ cli_args = [
+ hosts,
+ '--disable-default-role',
+ '--osinfo-version', '1'
+ ]
+ if args[:hypervisor]
+ cli_args += ['--hypervisor', args[:hypervisor]]
+ end
+ cli = BeakerHostGenerator::CLI.new(cli_args)
FileUtils.mkdir_p('tmp') # -p ignores when dir already exists
File.open(hosts_file, 'w') do |fh|
fh.print(cli.execute)
end
ENV['HOSTS'] = hosts_file