Register hosts to Satellite6 via CloudForms and Ansible Tower part 2

This post will show you how to add Ansible Tower as a provider in CloudForms, discover and create a catalog item out of a job template we’ve created and order the catalog item via self service portal.

If you followed part 1 you now have a fully functional Ansible Tower which we can add as a provider to Red Hat CloudForms.

Step 1 Login to CloudForms
logincfme

Step 2 Go to Configuration -> Configuration Management
configurationmanagement

Step 3 Click on Configuration and add a new provider
addnewprovider

Step 4 Fill in the following values (of course it needs to match your environment)
addtowerprov
Now validate your credentials
validate
and hit add
addcfme

Step 5 After Adding the provider you will see that CloudForms will discover the created job template from Ansible Tower
towerjobs

Step 6 Click on the sat6register job template
screen-shot-2016-09-20-at-5-23-34-pm
Then click configuration -> Create Service Dialog from this Job Template
createdialogfromtemplate

In my case I did name the template reghosts_to_sat6
screen-shot-2016-09-20-at-5-29-05-pm
Click the save button on the bottom right
screen-shot-2016-09-20-at-5-30-44-pm

Step 7 Now its time to look at the actual service dialog which got created from the Ansible Job Template
Got to Automate -> Customization -> Service Dialogs and click on your service dialog. You will see a dialog which pretty much looks like this
selection_025
If you want to be able to edit the fields you have to uncheck the readonly box for each field. Per default they are set readonly!

Step 8 Believe it or not but this is a fully functional service dialog which can be added to a catalog in CloudForms. Part 4 of the series which I will release next week will show you how you can make some of these fields dynamic.

Step 9 Create a catalog. Go to Services -> Catalogs -> Catalogs and click on Configuration -> Create new catalog
screen-shot-2016-09-20-at-5-39-52-pm
Name the catalog however you like and add it
screen-shot-2016-09-20-at-5-40-50-pm

Step 10 Lets add the service dialog to the ansible catalog. Click on Services -> Catalogs -> Catalog items -> ansible -> Configuration -> Create new catalog item
screen-shot-2016-09-20-at-5-43-01-pm
As a catalog item type choose AnsibleTower
screen-shot-2016-09-20-at-5-43-59-pm
Add the following values to the catalog item and click add
screen-shot-2016-09-20-at-5-45-32-pm

Step 11 Lets add some color to the catalog item and add an ansible logo. Click on the newly created catalog item and upload the ansible logo.
selection_044

Step 12 login to the self service ui, you will find that under https://cloudformsfqdn/self_service
logincfme
Once logged in click on Service Catalog and you will see your ansible catalog item
screen-shot-2016-09-20-at-5-54-49-pm

Step 13 Click on the ansible catalog item and fill out the values. The limit is the host or hosts separated by “:” which you would like to register to Satellite6. The limit cannot be left empty and the host must exist in the Ansible Tower inventory unless you chose the tower inventory to update on launch of a job.
screen-shot-2016-09-20-at-5-55-54-pm
If you have entered all the correct values you can go ahead, add the item to the shopping cart
screen-shot-2016-09-20-at-5-59-20-pm
You can now click on the shopping cart on the top right and order the item
screen-shot-2016-09-20-at-5-59-31-pm

As this item was launched as a service you can follow the work flow under Services->Requests. Once the statemachine steps gets to launch_job you will see the job popping up in the Ansible Tower Console.

selection_024

After few second, the job is executed and registers the host with the Red Hat Satellite 6 server. The completion of the job can be validated in CloudForms under Services -> Requests or in the Satellite 6 UI.

The next part (part 3) of the blog series which I will release next week will show you how you can add that dialog as a button under vm instances.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


Hit Counter provided by laptop reviews