Manageiq Ansible Tower Service Catalog

Hey. I want to ask that i have integrated the ansible tower into manageiq and my jobs are setup on the ansible tower i can create services of that jobs and also able to run and its working fine. But i want to know is it possible to change some parameters from manageiq into my original yaml script when the service is going to be ordered ? for example at my ansible tower jobs scripts i have created an script of os_server.yml which will create an instance in openstack and it calls the API of openstack. is it possible to change the name using service dialog when ordering the service from manageiq ???

@gmccullough can you help @Asad_Rajput ?

@Asad_Rajput - Yes, what you are describing sounds possible.

When you add the Tower provider we inventory the Job Templates. From there you create a Service Dialog from the JobTemplate which is used when configuring the Ansible Tower Catalog Item. (Sounds like you have done all this and it is working.)

What you need to do is modify the Service Dialog and add additional fields which will be passed as extraVars to Tower as part of the service order.

Depending on the version of ManageIQ that you are running you want to navigate to the Automate -> Customization -> Service Dialogs (Left Nav) and select the dialog you are using with your Catalog Item.

Edit the dialog and add a new field. The important thing here is to prefix the field with param_ so the data gets passed along to Tower. For example, to pass the extraVar “new_name” to Tower the field should be called “param_new_name”.

Of course the Playbook that the JobTemplate is using will need to be updated to use this new variable as well.

Sir. I am using manageiq:fine in docker container, when i navigate to ->Customization->Service Dialog accordion or create new one diaglog. Than there is dialog information, dialog button, box, element where i can find field ?and where to pass param_new_name parameters ?

Kindly check the screen shots and guide me.

Sir Kindly check this i have changed param_name and when i order the service it ask:
But the parameters are not changing parameters are same.
this is my script which runs on tower it calls the API of openstack and create the security group inside the openstack.

  • name: Deploy on OpenStack
    gather_facts: false
    • name: Create a security group
      state: present
      username: asad
      password: pakistan
      project_name: gocha1
      user_domain_name: default
      project_domain_name: default
      name: apple
      description: this is for apple users

@gmccullough @Fryguy Hey, can one help me out here ??

@bill Can you verify that this last screenshot looks correct? I believe the issue here is that they are not using substitution on the extraVar we pass when launching the Job Template.

@Asad_Rajput I am not good at composing ansible playbook. It seems to me that in your playbook you did not declare name is a variable. Even if a variable named name is passed in, how do you use it?

@bill @gmccullough The Name Which i am using in playbook is in yaml format and it is using shade module for automation of openstack using its API. So question you asked me for passing named as a name in my playbook is the method of os_security_group if i dont use name than it will not work. If you could help me to automate security_groups of openstack using manageiq automation other than ansible-tower than please guide me on that way. my task is just to automate openstack cloud using mangeiq for creating service catalogs :slight_smile:

Hi Asad

There are some examples of calling Ansible Tower job templates from ManageIQ/CloudForms Automate in these chapters and blogs:

One the of the things that catches people out is that you need to make sure that you have the ‘Prompt on launch’ tickbox ticked in Tower for the limits and extra_vars, otherwise ManageIQ/CloudForms won’t be able to override them when it launches the job template.

Hope this helps,

@Asad_Rajput try to modify your playbook

  sg_name: apple

  name: Create a security group
    name: {{ sg_name }}

Try to avoid use a variable just call name because it is too common and confusing.
Then in the service dialog create a textfield param_sg_name

@bill Dear the problem is this, i am using shade module os_security_group. Check the link please
The option of name in my script is required there is no any option to add vars: for name if so than please guide i have tried alot of time there are errors in playbook.

Can you post your final script (playbook) and the error?

@bill Dear i will share you a detail question that i really want to do with screen shot so it will be easy for you to understand. :slight_smile: