-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add orchestration_stacks to ServiceAnsiblePlaybook #14248
Conversation
Well put @jntullo SUI NEEDS 🌮 💃 |
app/models/service.rb
Outdated
@@ -37,6 +37,7 @@ class Service < ApplicationRecord | |||
virtual_has_many :vms | |||
virtual_has_many :all_vms | |||
virtual_has_many :power_states, :uses => :all_vms | |||
virtual_has_many :jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change :jobs
to :orchestration_stacks
@@ -45,6 +45,12 @@ def postprocess(action) | |||
delete_inventory(action) unless use_default_inventory?(hosts) | |||
end | |||
|
|||
def jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def orchestration_stacks
service_resources.where(:resource_type => 'OrchestrationStack').each_with_object({}) do |sr, hash|
hash[sr.name] = sr.resource
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzwei I had this initially, but I found that my sample data had multiple resources for the same action, which is why I thought I'd utilize job. Is this just an anomaly due to bad data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have one Provision and one Retirement job, but for Reconfigure that we may support in the future, it can have multiple jobs.
I am hesitated too about this matter. We don't have clear answer whether we want to support Reconfigure. If so, even the existing job
method needs to return an array.
@miq-bot assign @gmcculloug |
@@ -45,6 +45,12 @@ def postprocess(action) | |||
delete_inventory(action) unless use_default_inventory?(hosts) | |||
end | |||
|
|||
def orchestration_stacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second thought - the method should not return a hash. Just like vms
, an array is better. And this method can be moved to Service
thus good for Orchestration and AnsibleTower services too.
jobs to orchestration stacks move from service_ansible_playbook to service
Checked commit jntullo@b92057d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@gmcculloug done 👍 |
while it would be nice to retain the action, the action can be retrieved from the service resource |
OH GLORIOUS DAY!!!! 🌮 💃 |
The SUI needs to be able to access the jobs on a
ServiceAnsiblePlaybook
. This returns them as an array:cc: @AllenBW
thoughts @bzwei ?
@miq-bot add_label enhancement, services