Chapter 3. Automation Management Providers
In Red Hat CloudForms, an automation management provider is a management tool that integrates with CloudForms to simplify automation operations for your resources. This chapter describes the automation management providers that you can use with Red Hat CloudForms, and how to work with them.
Red Hat CloudForms provides automation management features through the following:
Automate enables real-time, bi-directional process integration. This provides you with a method to implement adaptive automation for management events and administrative or operational activities.
Ansible integration delivers out-of-the-box support for backing service, alert and policy actions using Ansible playbooks. Sync your existing playbook repositories with CloudForms, add credentials to access providers, and create service catalog items for actions ranging from creating and retiring VMs, updating security software, or adding additional disks when space runs low.
Ansible Tower is a management tool integrated with CloudForms, designed to help automate infrastructure operations utilizing existing Ansible Tower providers in your inventory. CloudForms allows you to execute Ansible Tower jobs using service catalogs and Automate. Using Ansible Tower, you can schedule Ansible playbook runs and monitor current and historical results, allowing for troubleshooting or identification of issues before they occur.
3.1. Ansible
Ansible integrates with Red Hat CloudForms to provide automation solutions, using playbooks, for Service, Policy and Alert actions. Ansible playbooks consist of series of plays or tasks that define automation across a set of hosts, known as the inventory.
Ranging from simple to complex tasks, Ansible playbooks can support cloud management:
- Services - allow a playbook to back a CloudForms service catalog item.
- Control Actions - CloudForms policies can execute playbooks as actions based on events from providers.
- Control Alerts - set a playbook to launch prompted by a CloudForms alert.
Ansible is built into CloudForms so there is nothing to install. The basic workflow when using Ansible in Red Hat CloudForms is as follows:
- Enable the Embedded Ansible server role.
- Add a source control repository that contains your playbooks.
- Establish credentials with your inventory.
- Back your services, alerts and policies using available playbooks.
3.1.1. Enabling the Embedded Ansible Server Role
In Red Hat CloudForms, the Embedded Ansible role is disabled by default. Enable this server role to utilize Ansible Automation Inside.
Configure your CloudForms appliance network identity (hostname/IP address) before enabling the Embedded Ansible server role. Restart the evmserverd service on the appliance with the enabled Embedded Ansible server role after making any changes to the hostname or IP address.
- Navigate to the settings menu, then Configuration → Settings.
- Select the desired server under Zones.
- Set the Server Role for Embedded Ansible to On.
3.1.2. Verifying the Embedded Ansible Worker State
Verify that the Embedded Ansible worker has started to utilize its features.
- Navigate to the settings menu, then Configuration → Diagnostics and click on the desired server.
- Click on the Workers tab.
A table of all workers and current status will appear from which you can confirm the state of your embedded Ansible worker.
3.1.3. Adding a Playbook Repository
Add a repository so that Red Hat CloudForms can discover and make available your playbooks.
- Navigate to → → .
- Click Add.
- Provide a Repository Name in the Name field.
- Add a description for the repository in the Description field.
- Select an SCM Type from the drop-down menu.
- Add a URL or IP Address for the repository.
- Select the appropriate SCM Credentials from the drop-down menu.
- Provide a branch name in the SCM Branch field.
- Check the appropriate box for any SCM Update Options.
- Click Add.
Once you have synced a repository, its playbooks will become available to CloudForms.
3.1.4. Refreshing Repositories
Red Hat CloudForms allows you to refresh a targeted playbook repository or all repositories in your inventory to ensure your playbooks are current.
Refresh a targeted repository:
- Navigate to → → .
- Click on a repository.
-
Click
(Configuration), then
(Refresh this Repository).
Alternately, you can refresh some or all repositories from the list view:
- Navigate to → → .
- Check those repositories to refresh. Click Check All to select all repositories.
-
Click
(Configuration), then
(Refresh Selected Ansible Repositories).
3.1.5. Adding Credentials
Red Hat CloudForms can store credentials used by playbooks. Credentials saved in CloudForms are matched and executed with a playbook when run.
If both CloudForms and a VMware provider are located in the same IPv6-only network, use a DNS-resolvable hostname for the VMware provider in the vCenter Host field when adding credentials.
- Navigate to → → .
-
Click
(Configuration), then
(Add a New Credential).
- Provide a Name for the credential.
- Select the Credential Type. Additional fields will appear depending on the type chosen.
- Click Add.
3.2. Ansible Tower
Ansible Tower is a management tool integrated with Red Hat CloudForms, designed to help automate infrastructure operations. Red Hat CloudForms allows you to execute Ansible Tower jobs using service catalogs and Automate. No custom configuration or Ruby scripting is needed in Red Hat CloudForms, as configuration is done in Ansible Tower using playbooks.
You can use the large library of existing Ansible playbooks as Red Hat CloudForms state machines to automate tasks such as backups, package updates, and maintenance in your Red Hat CloudForms environment. This also includes deploying Red Hat Satellite agents on bare metal machines as required. This can be particularly useful for quickly applying changes across large environments with many virtual machines or instances. Using Ansible Tower, you can schedule Ansible playbook runs and monitor current and historical results, allowing for troubleshooting or identification of issues before they occur.
The basic workflow when using Red Hat CloudForms with an Ansible Tower provider is as follows:
- Create an Ansible playbook which performs a specific task.
- A new Ansible Tower job template is created from the playbook, which is then retrieved by Red Hat CloudForms.
- From the Ansible Tower job template, create a new catalog item in Red Hat CloudForms, optionally with a service dialog that allows the user to enter parameters if needed.
- The user orders the service from the Red Hat CloudForms user interface, and fills out any additional arguments (for example, limiting the task to run on a specific set of virtual machines).
- The job executes.
For more information on Ansible playbooks, see the Ansible playbook documentation.
3.2.1. Adding an Ansible Tower Provider
To access your Ansible Tower inventory from Red Hat CloudForms, you must add Ansible Tower as a provider.
- Navigate to → → and click on the Providers accordion tab.
-
Under
Configuration, click
Add a new Provider.
In the Add a new Provider area:
- Enter a Name for the new provider.
- Add a Zone for the provider.
- Enter the URL location or IP address to the Ansible Tower server.
- Select the Verify Peer Certificate checkbox if desired.
- In the Credentials area, provide the Username and Password, and Confirm Password.
- Click Validate to verify credentials.
- Click Add.
After adding the Ansible Tower provider, refresh its relationships and power states in order to view the current inventory.
3.2.2. Refreshing an Ansible Tower Provider
Refresh relationships of all items related to an existing Ansible Tower configuration management provider including inventory, hosts, virtual machines, and clusters.
You can refresh inventory from Red Hat CloudForms, or by enabling the Update on Launch option for inventory groups in Ansible Tower. The Update on Launch option allows Ansible Tower to automatically update inventory using a dynamic inventory script before launching an Ansible Tower job from a playbook. See the Ansible Tower documentation for more information.
It can take a long time to retrieve information from providers containing many virtual machines or instances. The Ansible Tower dynamic inventory script can be modified to limit updates to specific items and reduce refresh time.
To refresh an Ansible Tower provider’s inventory in Red Hat CloudForms:
- Navigate to → → and click the Providers accordion tab.
- Select the checkboxes for the Ansible Tower providers to refresh under All Ansible Tower Providers.
-
Click
(Configuration), and then
(Refresh Relationships and Power States).
- Click OK.
Red Hat CloudForms then queries the Ansible Tower API and obtains an inventory of all available hosts and job templates.
3.2.3. Viewing Ansible Tower Providers and Inventory
Red Hat CloudForms automatically updates its inventory from Ansible Tower. This includes system groups (known as Inventories in Ansible Tower), basic information about individual systems, and available Ansible Tower job templates to be executed from the service catalog or Automate.
To view and access Ansible Tower inventories and job templates in Red Hat CloudForms, you must first create them in Ansible Tower.
To view a list of Ansible Tower providers and inventory:
- Navigate to → → .
- select the Providers accordion menu to display a list of All Ansible Tower Providers.
- Select your Ansible Tower provider to expand and list the inventory groups on that Ansible Tower system. The inventory groups can be expanded to view the systems contained within each group, as well as configuration details for these systems.
Similarly, all discovered job templates are accessed under the provider by expanding the → → → accordion menu.
3.2.4. Viewing Ansible Tower Configured Systems
To view the systems in your Ansible Tower inventory:
- Navigate to → → → .
- Under All Ansible Tower Configured Systems, select Ansible Tower Configured Systems to display a list.
3.2.5. Executing an Ansible Tower Job Template from a Service Catalog
You can execute an Ansible Tower playbook from Red Hat CloudForms by creating a service catalog item from an Ansible Tower job template.
You must first create the job template in Ansible Tower. The job templates are automatically discovered by Red Hat CloudForms when refreshing your Ansible Tower provider’s inventory.
First, create a catalog:
- Navigate to → .
-
Click
(Configuration), then
(Add a New Catalog)
- Enter a Name and Description for the catalog.
- Click Add.
Then, create an Ansible Tower service catalog item:
- Navigate to → → .
- Click Ansible Tower Job Templates and select an Ansible Tower job template.
-
Click
(Configuration), then
(Create Service Dialog from this Job Template).
- Enter a Service Dialog Name (for example, ansible_tower_job)and click Save.
- Navigate to → . Click Catalog Items.
Click
(Configuration), then
(Add a New Catalog Item) to create a new catalog item with the following details, at minimum:
- For Catalog Item type, select Ansible Tower.
- Enter a Name for the service catalog item.
- Select Display in Catalog.
- In Catalog, select the catalog you created previously.
- In Dialog, select the service dialog you created previously (in this example, ansible_tower_job). No Dialog can be selected if the playbook does not require extra variables from the user. To ask the user to enter extra information when running the task, Service Dialog must be selected.
- In Provider, select your Ansible Tower provider. This brings up the Ansible Tower Job Template option and configures the Provisioning Entry Point State Machine automatically.
- Add configuration information for Reconfigure Entry Point and Retirement Entry Point as applicable.
Select your desired Ansible Tower Job Template from the list. Generally, this is the Ansible Tower job template previously used to create the service dialog.
- Click Add. The catalog item you created will appear in the All Service Catalog Items list.
To execute the Ansible Tower job:
Navigate to → .
- Click Order for the catalog item.
- Enter any variables requested and click Submit.
Red Hat CloudForms takes you to the Requests queue page and show the status of the job.
The service item’s details can be viewed in → in Red Hat CloudForms.
Instead of running a single job at a time, multiple service catalog items can also be grouped together as a catalog bundle to create one deployment with multiple job templates. See Catalogs and Services in Provisioning Virtual Machines and Hosts for more information.
3.2.6. Executing an Ansible Tower Job Using a Custom Automate Button
Red Hat CloudForms can execute Ansible Tower jobs on virtual machines or instances using custom buttons in Automate.
Ansible Tower jobs can either be non-customizable, which do not require any extra configuration from the user, or alternatively, they can allow the user to specify a parameter (for example, a package name to install). In Ansible Tower jobs containing a dialog, Red Hat CloudForms accepts additional information from the user and adds it to the appropriate API call in Automate, and then sends it into Ansible Tower.
Prerequisites
Before creating an Automate button to execute an Ansible Tower job, the following must be configured:
- An Ansible playbook in Ansible Tower. See the Ansible Tower documentation for instructions.
- Ansible Tower must be able to reach virtual machines or instances deployed by Red Hat CloudForms at the IP level.
-
The virtual machine template must have the Ansible Tower environment’s public SSH key injected. For cloud instances,
cloud-initcan be used and the public SSH key can be passed without rebuilding the image. - Any dynamic inventory scripts used must be configured to return the virtual machine names exactly as they are stored in Red Hat CloudForms, without the UUID appended.
Executing an Ansible Tower Job using a Custom Automate Button
To configure a custom button to execute an Ansible Tower job on a virtual machine or instance, first create the button:
- Navigate to → → .
- Click the Buttons accordion menu.
- Click → . This configures the button to run on virtual machines or instances.
Click
(Configuration), then click
(Add a new Button).
- In the Adding a new Button screen, configure the Action parameters as desired. Dialog can be left blank if the playbook does not require extra variables. To ask the user to enter extra information when running the task, Service Dialog must be selected.
Configure Object Details fields with the following request details:
- For System/Process, select Request.
- For Message, enter create.
- For Request, enter Ansible_Tower_Job.
Configure Attribute/Value Pairs with the following parameters:
- job_template_name is the Ansible Tower job template name to associate with the button. The job_template_name field is mandatory; other parameters are provided by the Tower job dialog.
Configure Visibility to all users, or limit visibility by role as desired.
- Click Add.
If you do not have an existing button group to assign the new button to, create a new button group:
From → → , navigate to → → , and configure the following:
-
Configure Basic Info as desired. For example, name the button group
VM Actions. In Assign Buttons, select the button you just created from the Unassigned list and click
to assign it to Selected.
- Click Add.
-
Configure Basic Info as desired. For example, name the button group
To assign the button to an existing button group:
- Navigate to → → → .
-
In Assign Buttons, select the button you just created from the Unassigned list and click
to assign it to Selected.
- Click Add.
To use the button to run an Ansible Tower job on a virtual machine:
- Navigate to → → .
- Select the virtual machine to run the Ansible Tower job template on.
Click the VM Actions button to show the button you created, and click the button from the list to run the Ansible Tower job template.
- Click Submit to execute the job.
Red Hat CloudForms then confirms the job has been executed.
If you selected a service dialog to run when creating the button, Red Hat CloudForms will then prompt you to enter variables to complete the task. After entering your desired parameters, Red Hat CloudForms takes you to the Requests page.
The service item’s details can be viewed in → in Red Hat CloudForms.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.