In this second part of the lab we want to use an Ansible Playbook to deploy a Virtual Machine in VMware vCenter. The necessary Playbook should already be in your repository.
Click on Catalog Items in the accordion on the left
Click on Configuration -> Add a New Catalog Item
Select Ansible Playbook as “Catalog Item Type”
Do not select Ansible Tower! We do not use Ansible Tower in this lab, but the embedded Ansible role of CloudForms.
Fill out the form to define the Service Catalog Item:
Name: Provision Virtual Machine
The name of the Service Catalog Item.
Description: Order this catalog item provision a Virtual Machine on VMware vCenter
More description details about the Service Catalog Item.
Display in Catalog: Yes (check the box)
Check this box to make the Service Catalog Item visible in the Service Catalog. This remains unselected for Service Catalog Items which are still in draft mode or should only be used as a part of a Service Catalog Bundle.
Catalog: Ansible
The Service Catalog in which this Service Catalog Item should be listed.
Repository: Github
The Git repository from which we want to run our Playbook.
Playbook: create_vm_from_template.yml
The name of the actual Playbook.
Machine Credentials: CFME Default Credentials
Credentials used to run the Playbook.
Cloud Type: VMware
If you want to run your Playbook against a Cloud Provider, you have to select which one.
Cloud Credentials: vCenter
The credentials used to log into the Cloud Provider.
In the box Variables & Default Values we can enter the variables the Playbook requires. Those variables are defined in the Ansible Playbook. By specifying them here, CloudForms can populated those variables when somebody order the Service Catalog Item.
If you want to learn more about variables in Ansible Playbooks, have a look at the Ansible Documentation.
Variable: vcenter_hostname
Default: vcenter.example.com
Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:
Variable: esxi_host
Default: 192.168.0.51
Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:
Variable: datacenter
Default: DC01
Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:
Variable: template
Default: rhel6tmpl
Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:
Variable: vmname
Default: changeme
Click on the little plus icon (+) to save the variable.
Dialog: create new
Dialog name: provision-vm-vcenter
Click on Add to save the Service Catalog Item. It can take a few moments for the changes to be saved.