Skip to content

Commit

Permalink
Merge pull request #17804 from bzwei/ansible_workflow_or_job
Browse files Browse the repository at this point in the history
ServiceAnsibleTower to provision both job and workflow
  • Loading branch information
gmcculloug authored Aug 13, 2018
2 parents e8ff2a4 + f83b0fe commit 70eefac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/service_ansible_tower.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class ServiceAnsibleTower < Service
alias_method :job_options=, :stack_options=

def launch_job
@job = ManageIQ::Providers::AnsibleTower::AutomationManager::Job.create_job(job_template, job_options)
job_class = "#{job_template.class.parent.name}::#{job_template.class.stack_type}".constantize
@job = job_class.create_job(job_template, job_options)
add_resource(@job)
@job
ensure
Expand Down
4 changes: 2 additions & 2 deletions spec/models/service_ansible_tower_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe ServiceAnsibleTower do
let(:tower) { FactoryGirl.create(:automation_manager_ansible_tower) }
let(:template_by_dialog) { FactoryGirl.create(:configuration_script, :manager => tower) }
let(:template_by_setter) { FactoryGirl.create(:configuration_script, :manager => tower) }
let(:template_by_dialog) { FactoryGirl.create(:ansible_configuration_script, :manager => tower) }
let(:template_by_setter) { FactoryGirl.create(:ansible_configuration_script, :manager => tower) }

let(:dialog_options) do
{
Expand Down

0 comments on commit 70eefac

Please sign in to comment.