Lab Guide: Automating Day-2 Cloud Operations with AWS
A guide to using Ansible Automation Platform for Day-2 cloud operations, including dynamic inventories, job templates, and workflows.
Lab Briefing
This section provides an overview of the lab environment and key concepts in Ansible Automation Platform.
Lab Instructions
Please click the green Start button on the bottom right corner to create the lab environment if it has not already started. To navigate through this briefing, click the white > arrow on the right.

Automation controller
The control plane for Ansible Automation Platform is the automation controller. It helps standardize how automation is deployed, initiated, delegated, and audited. You can manage inventory, launch and schedule workflows, track changes, and integrate reporting, all from a centralized user interface and RESTful API.

Inventories
An inventory is a collection of hosts against which automation jobs can be launched, similar to an Ansible inventory file. Inventories are divided into groups, and these groups contain the actual hosts. Groups can be sourced manually or dynamically from a supported cloud provider using Inventory Plugins.
Some of the available inventory plugins include:
-
Amazon Web Services EC2
-
Google Compute Engine
-
Microsoft Azure Resource Manager
-
VMware vSphere and vCenter
Lab Diagram
The lab topology consists of one Ansible Automation Platform controller node and two Red Hat Enterprise Linux nodes running in Amazon Web Services (AWS) as Elastic Compute Cloud (EC2) instances.

Lab Guide: Hands-On Tasks
Estimated time to complete: 15 minutes
Welcome to the Ansible Hybrid Cloud Automation - Cloud Operations lab. In this first challenge, you will learn about the pre-configured Dynamic Inventory for this lab and how it uses tags to identify resources.
Task 1: Understanding Credentials
First, you will log in and examine the pre-configured credentials for this lab.
-
Navigate to the Automation Controller UI.
Click on the Automation Controller tab at the top of your lab window.
-
Log in with the provided credentials.
Username
adminPassword
ansible123! -
Examine the pre-configured credentials.
In this lab, we use two different credentials:
-
RHEL on AWS - SSH KEY: An SSH key for connecting to the RHEL hosts.
-
AWS_Credential: An AWS credential for performing actions on the cloud.
To view them, navigate to Automation Execution → Infrastructure → Credentials in the left navigation menu.
-
| Credential keys are encrypted. Once entered into the automation controller, no one, including administrators, can view the sensitive values. |
Task 2: Synchronize the AWS Inventory
Next, you will synchronize the dynamic inventory to ensure the automation controller has the latest host information from AWS.
-
Navigate to the Inventories menu.
In the left navigation menu, go to Automation Execution → Infrastructure → Inventories.
-
Select the AWS Inventory.
Click on the inventory named
AWS Inventory. -
Synchronize the inventory source.
Select the Sources tab and click the Sync button (the icon with two circling arrows). This will update the host list from AWS.
-
View the updated hosts.
Wait for the synchronization job status to show Success, then click on the Hosts tab to view the discovered EC2 instances.
Task 3: Create a Job Template to Retrieve EC2 Information
Now, you will create a job template to run a playbook that gathers and displays information about your EC2 instances.
-
Navigate to the Templates page.
In the left navigation menu, go to Automation Execution → Templates.
-
Initiate the creation of a new job template.
Click the Create template button, then select Create job template.

-
Enter the job template details.
Fill out the form with the following information:
Parameter
Value
Name
Retrieve EC2 informationInventory
AWS InventoryProject
AWS Demo ProjectPlaybook
playbooks/lab2-ec2-info.ymlCredentials
AWS_CredentialTo select the AWS_Credential, you may need to first filter the Credential Type toAmazon Web Services. -
Save and launch the job template.
Scroll to the bottom, click Save, and then Launch the template. Observe the output of the job run.
| In a highly dynamic environment, the AWS inventory can change often. It’s important to trigger an inventory synchronization before running jobs that rely on that inventory. We will address this in the next task. |
Task 4: Build a Workflow to Sync and Retrieve Information
To ensure you are always working with the latest inventory, you will create a workflow that first syncs the AWS inventory and then runs the job template to retrieve EC2 information.
-
Navigate to the Templates page and initiate workflow creation.
Go to Automation Execution → Templates, click the Create template button, and select Create workflow job template.

-
Enter the workflow details.
Parameter
Value
Name
WORKFLOW - Retrieve EC2 informationInventory
AWS InventoryClick Create workflow job template. The Workflow Visualizer will open.
-
Add the first node (Inventory Sync).
Click the Start button. In the Add Node dialog, configure the first step:
-
Node Type: Select
Inventory Source Sync. -
Inventory Source: Select
AWS Source. -
Click Next, then Save.
-
-
Add the second node (Job Template).
Hover over the
AWS Sourcenode you just created, click the + icon, and select Add node. Configure it as follows:-
Run type: Ensure
On Successis selected. -
Node Type: This should default to
Job Template. -
Job Template: Select
Retrieve EC2 information. -
Click Next, then Save.
-
-
Save and launch the workflow.
In the top right corner of the Visualizer, click Save. Then, navigate back to the Templates page and launch the
WORKFLOW - Retrieve EC2 informationtemplate.
This workflow ensures your inventory is always up-to-date before you attempt to gather information from it.