Skip to content

Commit

Permalink
Merge pull request #15787 from lfu/ansible_manageiq_payload_group_148…
Browse files Browse the repository at this point in the history
…0019

Add group in manageiq payload for ansible automation.
  • Loading branch information
gmcculloug authored Aug 11, 2017
2 parents 81d444b + 5b76396 commit 61474a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/service_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def manageiq_extra_vars(action)
'api_token' => Api::UserTokenService.new.generate_token(evm_owner.userid, 'api'),
'service' => href_slug,
'user' => evm_owner.href_slug,
'group' => miq_group.href_slug,
'action' => action
}.merge(request_options_extra_vars)
end
Expand Down
3 changes: 2 additions & 1 deletion spec/models/service_ansible_playbook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@
miq_request_task = FactoryGirl.create(:miq_request_task)
miq_request_task.update_attributes(:options => {:request_options => {:manageiq_extra_vars => control_extras}})
loaded_service.update_attributes(:evm_owner => FactoryGirl.create(:user),
:miq_group => FactoryGirl.create(:miq_group),
:miq_request_task => miq_request_task)
end

it 'creates an Ansible Tower job' do
expect(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job).to receive(:create_job) do |jobtemp, opts|
expect(jobtemp).to eq(tower_job_temp)
exposed_miq = %w(api_url api_token service user) + control_extras.keys
exposed_miq = %w(api_url api_token service user group) + control_extras.keys
expect(opts[:extra_vars].delete('manageiq').keys).to include(*exposed_miq)

expected_opts = provision_options[:provision_job_options].except(:hosts)
Expand Down

0 comments on commit 61474a7

Please sign in to comment.