Skip to content

Commit

Permalink
Pass verbosity through for ansible playbook automate methods
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Jul 17, 2019
1 parent 424e806 commit 6473b88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_job_template
def launch_ansible_tower_job
set_status('launching tower job')

launch_options = options.slice(:extra_vars, :limit)
launch_options = options.slice(:extra_vars, :limit, :verbosity)
launch_options[:hosts] = hosts_array(options[:hosts])
tower_job = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job.create_job(temp_configuration_script, launch_options)
options[:tower_job_id] = tower_job.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
end

context 'with launch options' do
let(:options) { {:job_template_ref => 'jt1', :extra_vars => {:thing => "stuff"}} }
let(:options) { {:job_template_ref => 'jt1', :extra_vars => {:thing => "stuff"}, :verbosity => "4"} }
it 'passes them to the job' do
expect(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job).to receive(:create_job)
.with(an_instance_of(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript), :hosts => ["localhost"], :extra_vars => {:thing => "stuff"})
.with(an_instance_of(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript), :hosts => ["localhost"], :extra_vars => {:thing => "stuff"}, :verbosity => "4")
.and_return(double(:id => 'jb1'))
expect(subject).to receive(:queue_signal)
subject.launch_ansible_tower_job
Expand Down

0 comments on commit 6473b88

Please sign in to comment.