Skip to content

Commit

Permalink
Added job_template method to model and service model
Browse files Browse the repository at this point in the history
For ServiceTemplateAnsiblePlaybook expose the job_template
associated with a service action
  • Loading branch information
mkanoor committed Feb 13, 2017
1 parent 91aeff7 commit e5da2b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/service_template_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ def self.default_retirement_entry_point
'/Service/Generic/StateMachines/GenericLifecycle/retire'
end

def job_template(service_action)
item = resource_actions.detect { |ra| ra.action == service_action }
item.configuration_template if item
end

# create ServiceTemplate and supporting ServiceResources and ResourceActions
# options
# :name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module MiqAeMethodService
class MiqAeServiceServiceTemplateAnsiblePlaybook < MiqAeServiceServiceTemplateGeneric
expose :job_template
end
end

0 comments on commit e5da2b3

Please sign in to comment.