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

add create_catalog_item to ServiceTemplateAnsibleTower #13646

Merged
merged 2 commits into from
Jan 31, 2017
Merged

add create_catalog_item to ServiceTemplateAnsibleTower #13646

merged 2 commits into from
Jan 31, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Jan 24, 2017

This adds class method create_catalog_item to ServiceTemplateAnsibleTower and takes in the following:

      {
        :name         => 'Ansible Tower',
        :service_type => 'generic_ansible_tower',
        :prov_type    => 'amazon',
        :display      => 'false',
        :description  => 'a description',
        :config_info  => {
          :configuration_script_id => configuration_script.id,
          :provision               => {
            :fqname            => ra1.fqname,
            :dialog_id => service_dialog.id
          },
          :retirement              => {
            :fqname            => ra2.fqname,
            :dialog_id => service_dialog.id
          }
        }
      }

@miq-bot add_label wip, enhancement, orchestration, services, euwe/no
@miq-bot assign @bzwei

create(options.except(:config_info)) do |service_template|
config_info = validate_config_info(options)

service_template.job_template = ConfigurationScript.find(config_info[:configuration_script_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to accept :configuration_script_id or :configuration. The later points to an object that can be directly assigned. Same to manager. Need to update the validate method too.

@jntullo jntullo changed the title [WIP] add create_catalog_item to ServiceTemplateAnsibleTower add create_catalog_item to ServiceTemplateAnsibleTower Jan 26, 2017
@jntullo
Copy link
Author

jntullo commented Jan 26, 2017

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Jan 26, 2017
create(options.except(:config_info)) do |service_template|
config_info = validate_config_info(options)

service_template.job_template = if config_info[:configuration_script_id]
Copy link
Contributor

Choose a reason for hiding this comment

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

@jntullo
Wouldn't a single service template have a job template per resource action (provision, reconfigure, retirement).
Its not a one to one relationship, I think its 1 to max 3 job templates.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mkanoor this is the refactoring work for existing AnsibleTower. The work you're interested is #13600

@bzwei
Copy link
Contributor

bzwei commented Jan 26, 2017

@miq-bot assign @gmcculloug

@miq-bot miq-bot assigned gmcculloug and unassigned bzwei Jan 26, 2017
end
private_class_method :validate_config_info

def create_resource_actions(ae_endpoints)
Copy link
Member

Choose a reason for hiding this comment

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

@jntullo This method does not appear to differ from the one in the parent ServiceTemplate model here: app/models/service_template.rb#create_resource_actions

Is this really needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right. It should not be needed. Good catch.

allow for configuration to be passed in
@miq-bot
Copy link
Member

miq-bot commented Jan 30, 2017

Checked commits jntullo/manageiq@51f4ac3~...22fa778 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 🍰

@gmcculloug gmcculloug merged commit 848e68b into ManageIQ:master Jan 31, 2017
@gmcculloug gmcculloug added this to the Sprint 54 Ending Feb 13, 2017 milestone Jan 31, 2017
@jntullo jntullo deleted the enhancement/create_service_template_ansible_tower branch November 28, 2017 19:43
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.

5 participants