Lab Guide: Creating Dynamic Documentation for Azure
1. Lab Guide: Hands-On Tasks
Estimated time to complete: 20 minutes
Welcome to the third challenge. You will now generate an HTML website using the structured data gathered from your Azure environment.
First, log in to the automation controller with the following credentials.
Username |
|
Password |
|
1.1. Task 1: Create the "Create Azure Cloud Report" Job Template
You will start by creating a job template that runs a playbook to generate the cloud report.
-
Navigate to the Templates page.
Expand the
Automation Executionmenu on the left.Automation Execution→Templates. -
Create a new job template.
Click the
+ Create Templatethen scroll down and clickCreate job template -
Enter the job template details.
Fill out the form with the following information:
Parameter
Value
Name
Create Azure Cloud ReportJob Type
RunInventory
Azure InventoryProject
Cloud Visibility ProjectPlaybook
playbooks/cloud_report_azure.ymlExecution Environment
Microsoft Azure Execution EnvironmentCredentials
azure_credentialANDRHEL on AzureTo select the azure_credential, click in the text field or on the drop down icon, then selectazure_ credential | Microsoft Azure Resource Manager. Same for theRHEL on Azurecredential, click in the text field or on the drop down icon, then selectRHEL on Azure | Machine. -
Save the job template.
Click the blue
Create job templatebutton. -
Add the following survey question.
Navigate to the
Surveytab and click the blueCreate survey questionbutton. Configure the following question as follows:Parameter
Value
Question
Where should the Azure Cloud report be generated?Answer variable name
report_serverAnswer type
TextDefault answer
reportserverClick
Create survey question. -
Enable the survey.
You must enable the survey by clicking the toggle switch at the top of the survey page. The text will change from
SURVEY DisabledtoSURVEY enabled.
The Ansible Playbooks for this lab are sourced from this project on GitHub.
1.2. Task 2: Launch the Job Template
Now you are ready to run the job and generate the report.
-
Launch the job template.
Navigate back to the Templates page. Find the
Create Azure Cloud Reporttemplate and click🚀 Launch templateicon.
-
Understand the playbook execution.
This playbook uses two roles:
-
The first role retrieves structured data for regions, virtual networks, and virtual machines.
-
The second role creates an HTML report. It installs a web server, copies assets (CSS, images), and uses the structured data to generate a dynamic website.
-
View the generated report. Locate the Azure Cloud Report URL from the Job Output.
Once the job completes, navigate to the bottom of the
Outputtab and locate the URL. It will look similar to this:http://<IP_ADDRESS>:80You will see a report similar to this:

1.3. Task 3: Analyze the Report
A cloud operator can use this report to quickly gain awareness of their cloud footprint. It combines information from several info modules, which correspond to multiple Azure API calls.
Important considerations for a cloud operator include:
-
How can we identify virtual networks in Azure that are not in use and can be safely deleted?
-
Which regions are running instances versus which ones are empty?
-
Which regions have stopped instances that may turn on at any moment?
2. Conclusion
You have successfully completed this lab! We hope you enjoyed learning about how Ansible can be used to create dynamic documentation for your Azure environment.
+
Press the End button to end the lab.
3. Troubleshooting
If you have encountered an issue or have noticed something not quite right, please open an issue on GitHub.