In this lab we will use an Ansible Playbook to create a local user in CloudForms. This example will also demonstrate how we can define a retirement process as well. In CloudForms’ understanding of complete life cycle management, every object has a provisioning and a retirement workflow.
Navigate to Services -> Catalogs
Click on Catalogs in the accordion on the left
Click on Configuration -> Add a New Catalog
Name: Ansible
Description: Ansible Service Catalog Items
Click Add to save the new catalog
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: Create User
Description: Order this catalog item to create a new user
Display in Catalog: Yes (check the box)
Catalog: Ansible
Repository: Github
Playbook: create-user.yml
Machine Credentials: CFME Default Credentials
In the box Variables & Default Values we can enter the variables the Playbook requires:
Variable: create_user_name
Default: example
Click on the little plus icon (+) to save the variable. Repeat the process for the second variable:
Variable: create_user_password
Default: secret
Click on the little plus icon (+) to save the variable.
Dialog: create new
Dialog name: create-user
Click on the tab Retirement to switch to the second page of the form.
Repository: Github
Playbook: delete-user.yml
Machine Credentials: CFME Default Credentials
There are no variables needed for retirement and the Variables & Default Values can be left empty.
Click on Add to save the catalog item