diff --git a/app/models/service_ansible_playbook.rb b/app/models/service_ansible_playbook.rb index 25d7ecc4ade..d436229fdc8 100644 --- a/app/models/service_ansible_playbook.rb +++ b/app/models/service_ansible_playbook.rb @@ -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 diff --git a/spec/models/service_ansible_playbook_spec.rb b/spec/models/service_ansible_playbook_spec.rb index 35a26312e45..680a61bcdc0 100644 --- a/spec/models/service_ansible_playbook_spec.rb +++ b/spec/models/service_ansible_playbook_spec.rb @@ -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)