Skip to content

Commit

Permalink
Merge pull request #113 from tphoney/MODULES-9170
Browse files Browse the repository at this point in the history
(MODULES-9170) allow for the new docker provisioner
  • Loading branch information
florindragos authored May 23, 2019
2 parents 2fe7bd5 + d7cb903 commit ee3b2c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puppet_litmus/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ def run_local_command(command)
raise "Failed to provision with '#{provisioner}'\n #{failed_image_message}" unless failed_image_message.empty?
end

desc "provision container/VM - abs/docker/vmpooler eg 'bundle exec rake 'litmus:provision[vmpooler, ubuntu-1604-x86_64]'"
desc "provision container/VM - abs/docker/vagrant/vmpooler eg 'bundle exec rake 'litmus:provision[vmpooler, ubuntu-1604-x86_64]'"
task :provision, [:provisioner, :platform] do |_task, args|
include BoltSpec::Run
Rake::Task['spec_prep'].invoke
config_data = { 'modulepath' => File.join(Dir.pwd, 'spec', 'fixtures', 'modules') }
raise "the provision module was not found in #{config_data['modulepath']}, please amend the .fixtures.yml file" unless File.directory?(File.join(config_data['modulepath'], 'provision'))

unless %w[abs vmpooler docker vagrant].include?(args[:provisioner])
raise "Unknown provisioner '#{args[:provisioner]}', try abs/docker/vmpooler/vagrant"
unless %w[abs docker docker_exp vagrant vmpooler].include?(args[:provisioner])
raise "Unknown provisioner '#{args[:provisioner]}', try abs/docker/vagrant/vmpooler"
end

params = { 'action' => 'provision', 'platform' => args[:platform], 'inventory' => Dir.pwd }
Expand Down Expand Up @@ -207,7 +207,7 @@ def run_local_command(command)
targets.each do |node_name|
# how do we know what provisioner to use
node_facts = facts_from_node(inventory_hash, node_name)
next unless %w[abs docker vmpooler vagrant].include?(node_facts['provisioner'])
next unless %w[abs docker docker_exp vagrant vmpooler].include?(node_facts['provisioner'])

params = { 'action' => 'tear_down', 'node_name' => node_name, 'inventory' => Dir.pwd }
result = run_task("provision::#{node_facts['provisioner']}", 'localhost', params, config: config_data, inventory: nil)
Expand Down

0 comments on commit ee3b2c5

Please sign in to comment.