Skip to content

Commit

Permalink
Use the queued method for ansible::runner
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jul 13, 2018
1 parent 7000ad5 commit 95fad7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def __find_instance_from_path(path)
aec.ae_instances.detect { |i| instance.casecmp(i.name) == 0 }
end

def ansible_runner(env_vars, extra_vars, playbook_path)
Ansible::Runner.run(env_vars, extra_vars, playbook_path)
def ansible_runner(queue_opts, env_vars, extra_vars, playbook_path)
Ansible::Runner.run_queue(env_vars, extra_vars, playbook_path, @workspace.ae_user, queue_opts)
end

private
Expand Down
5 changes: 3 additions & 2 deletions spec/miq_ae_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@
env_vars = {'ENV1' => 'VAL1', 'ENV2' => 'VAL2'}
extra_vars = {:ems_refs => %s(vm1 vm2)}
playbook_path = "/path/to/playbook"
queue_opts = {:role => "ems_operations"}

expect(Ansible::Runner).to receive(:run).with(env_vars, extra_vars, playbook_path)
expect(Ansible::Runner).to receive(:run_queue).with(env_vars, extra_vars, playbook_path, "Test User 1", queue_opts)

miq_ae_service.ansible_runner(env_vars, extra_vars, playbook_path)
miq_ae_service.ansible_runner(env_vars, extra_vars, playbook_path, queue_opts)
end
end
end
Expand Down

0 comments on commit 95fad7f

Please sign in to comment.