Skip to content
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

Save playbook service template #13600

Merged
merged 1 commit into from
Jan 26, 2017

Conversation

bzwei
Copy link
Contributor

@bzwei bzwei commented Jan 20, 2017

Create a service catalog item for type AnsiblePlaybook

@miq-bot add_label wip

@bzwei
Copy link
Contributor Author

bzwei commented Jan 20, 2017

@tinaafitz

@bzwei
Copy link
Contributor Author

bzwei commented Jan 25, 2017

cc @jntullo @syncrou @bdunne


info[:provision][:fqname] ||= default_provisioning_entry_point if info.key?(:provision)
info[:retirement][:fqname] ||= default_retirement_entry_point if info.key?(:retirement)
info[:reconfigure][:fqname] ||= default_reconfiguration_entry_point if info.key?(:reconfigure)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we weren't doing reconfigure yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend is made ready here, but UI will not provide reconfigure selection.

end

def self.prepare_job_template_and_dialog(action, service_name, description, config_info)
job_template = create_job_template("#{service_name}_#{action}", description, config_info[action])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider naming the job template name with something that can't change like "MiqService_#{id}_#{action}".

Copy link
Contributor Author

@bzwei bzwei Jan 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@syncrou will enhance the naming in his following up PR


build_options = {:action => action[:name], :fqname => fqname}
build_options.merge!(ae_endpoint.slice(:dialog, :dialog_id))
build_options.merge!(ae_endpoint.slice(:configuration_template, :configuration_template_id, :configuration_template_type))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a single slice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can. I split into two lines because the list is too long. Maybe we could create an array in one line and pass it to the slice method in the second line. @jntullo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just multi-line the params to slice

@miq-bot
Copy link
Member

miq-bot commented Jan 25, 2017

This pull request is not mergeable. Please rebase and repush.

@bzwei bzwei force-pushed the save_playbook_service_template branch from e604e15 to ddbfde0 Compare January 26, 2017 15:24
@bzwei bzwei changed the title [WIP] Save playbook service template Save playbook service template Jan 26, 2017
@bzwei
Copy link
Contributor Author

bzwei commented Jan 26, 2017

@miq-bot remove_label wip
@miq-bot remove_label "sql migration"

@miq-bot miq-bot removed the wip label Jan 26, 2017
@miq-bot
Copy link
Member

miq-bot commented Jan 26, 2017

@bzwei Cannot remove the following label because they are not recognized: "sql migration"

@bzwei
Copy link
Contributor Author

bzwei commented Jan 26, 2017

@miq-bot remove_label sql migration

private_class_method :create_job_template

def self.validate_config_info(options)
info = opitons[:config_info]
Copy link
Contributor

@syncrou syncrou Jan 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bzwei - Looks like a spelling error /opitons/options/

Initial implementation of .create_catalog_item
@bzwei bzwei force-pushed the save_playbook_service_template branch from 9b7fb42 to bc04d82 Compare January 26, 2017 16:57
@miq-bot
Copy link
Member

miq-bot commented Jan 26, 2017

Checked commit bzwei@bc04d82 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 3 offenses detected

app/models/service_template_ansible_playbook.rb

@gmcculloug gmcculloug merged commit d428689 into ManageIQ:master Jan 26, 2017
@gmcculloug gmcculloug added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants