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.
(cherry picked from commit 61474a7)

https://bugzilla.redhat.com/show_bug.cgi?id=1481445
  • Loading branch information
gmcculloug authored and simaishi committed Aug 14, 2017
1 parent f5a310f commit a6b6f14
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 a6b6f14

Please sign in to comment.