---
title: "Highly Effective Automation with Ansible AWX"
description: "Learn how Ansible AWX can take your Ansible playbooks to the next level and automate all the things with this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/ansible-awx/"
---

# Highly Effective Automation with Ansible AWX

> Learn how Ansible AWX can take your Ansible playbooks to the next level and automate all the things with this ATA Learning tutorial!

Source: https://adamtheautomator.com/ansible-awx/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Highly Effective Automation with Ansible AWX](https://adamtheautomator.com/wp-content/uploads/2022/06/Highly-Effective-Automation-with-Ansible-AWX.jpg)

# Highly Effective Automation with Ansible AWX

[![](https://secure.gravatar.com/avatar/2beb65fca997135120ed98dc6a2e57dcdf1a7d7d2f5ff687b5d91dc7ccd7a6b5?s=192&d=mm&r=g)Sagar](https://adamtheautomator.com/author/shanky-mendiratta/)15 June 20227 min. read

Categories: [DevOps](/category/devops/)

Tags:[Ansible](/tag/ansible/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing Dependencies and Configuring Ansible AWX](#installing-dependencies-and-configuring-ansible-awx)
*   [Installing and Starting Ansible AWX with Ansible Playbook](#installing-and-starting-ansible-awx-with-ansible-playbook)
*   [Creating and Managing Inventories](#creating-and-managing-inventories)
*   [Creating and Running Ansible Jobs](#creating-and-running-ansible-jobs)
*   [Conclusion](#conclusion)

Are you fed up with running Ansible playbooks and Ansible command manually every time on your Ansible host controller? Why not use a web interface and make your life easier with this Ansible AWX?

AWX is an open-source web application sponsored by Red Hat that provides a user interface and API to perform all Ansible tasks. And in this tutorial, you’ll learn to install Ansible AWX on an Ubuntu box and manage inventories using Ansible AWX.

Up your game with highly effective automation using Ansible AWX today!

## Prerequisites

This tutorial comprises step-by-step instructions. If you’d like to follow along, be sure you have the following in place:

*   An [Ansible controller host](https://docs.ansible.com/ansible/latest/installation_guide/index.html) – This tutorial uses Ansible v2.11.7 on Ubuntu 20.04.4 LTS version machine.

Related:[Guide: How to Setup Ansible (Ubuntu, RHEL, CentOS, macOS)](https://adamtheautomator.com/install-ansible/)

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   Docker – This tutorial uses Docker v19.03.11 on Ubuntu 20.04.4 LTS version machine.

Related:[How to Install and Use Docker on Ubuntu (In the Real World)](https://adamtheautomator.com/docker-ubuntu/)

*   Python v3.6 or later installed on your Ansible controller host machine – This tutorial uses Python v3.8.10.

Related:[How Do You Install Python 3.6?](https://adamtheautomator.com/install-python-36/)

*   A [GitHub account](https://github.com/join) with one private and one public repository created in GitHub that you will use to store Ansible Playbook.

## Installing Dependencies and Configuring Ansible AWX

Ansible AWS was the foundation for creating [Ansible Tower](https://docs.ansible.com/ansible/2.5/reference_appendices/tower.html). Ansible AWX makes Ansible more comfortable for IT teams to use for testing; in a lab, development, or other [POC environment](https://www.cloudshare.com/virtual-it-labs-glossary/what-is-a-proof-of-concept-poc-environment/).

Since Ansible AWS doesn’t come installed on your Linux system by default, you’ll first have to install Ansible AWS so you can run it as a multi-container using the Ansible Playbook.

1\. Run each command below to update your system packages and install the docker-compose-plugin.

```bash
# Update packages
sudo apt-get update
# Install Docker Compose
sudo apt-get install docker-compose-plugin
```

![Updating System Packages and Installing docker-compose](https://adamtheautomator.com/wp-content/uploads/2022/06/image.png)

Updating System Packages and Installing docker-compose

2\. Next, run the following command to verify the docker compose version installed on your machine.

```bash
docker compose version
```

The output below shows that the latest Docker Compose version v2.5.0 is installed, confirming Docker Compose is correctly installed.

![Verifying Docker Compose Version](https://adamtheautomator.com/wp-content/uploads/2022/06/image-1.png)

Verifying Docker Compose Version

3\. Run each command below to install packages as prerequisites to work with Ansible AWX.

```bash
# Installs NodeJS as AWS has a dependency on NodeJS.
sudo apt install nodejs npm
# Installs Python3, which runs Ansible Playbook later.
sudo apt install python3-pip git pwgen unzip
# Installs requests to allow you to send HTTP/1.1 requests easily.
sudo pip3 install requests==2.22.0 docker-compose==1.29.2
```

![Installing npm Software](https://adamtheautomator.com/wp-content/uploads/2022/06/image-2.png)

Installing npm Software

![Installing Python](https://adamtheautomator.com/wp-content/uploads/2022/06/image-3.png)

Installing Python

![Installing Requests](https://adamtheautomator.com/wp-content/uploads/2022/06/image-4.png)

Installing Requests

4\. Now, run the following commands to download (wget) the AWX package archive from the public Git repository, and then unzip the package.

```bash
# Download the AWX package archive
wget https://github.com/ansible/awx/archive/17.1.0.zip
# Unzip the AWX package archive
unzip 17.1.0.zip
```

![Downloading the AWS Package from the Git Repository](https://adamtheautomator.com/wp-content/uploads/2022/06/image-5.png)

Downloading the AWS Package from the Git Repository

Related:[Install Python Wget and Automate your File Downloads](https://adamtheautomator.com/python-wget/)

5\. Run the below commands to change (cd) to the AWX installation directory (awx-17.1.0/installer/), and generate the random password (pwgen).

> _Your AWX installation directory (awx-17.1.0/installer/) may differ depending on the Ansible AWX version installed on your machine._

```bash
cd awx-17.1.0/installer/
pwgen -N 1 -s 30
```

Note down the generated password as you’ll it as a secret key in the AWX console.

![Generating a Random Password](https://adamtheautomator.com/wp-content/uploads/2022/06/image-6.png)

Generating a Random Password

6\. Lastly, in your text editor, open the _inventory_ file within the AWX installer directory (_awx-17.1.0/installer/_). The _inventory_ file contains the configurations of AWX, which will be used while logging the AWX UI.

In the inventory file, change the value of admin\_password to password and secret\_key with the random password you generated in step five.

![Updating Credentials of Ansible AWX in the Inventory File](https://adamtheautomator.com/wp-content/uploads/2022/06/image-7.png)

Updating Credentials of Ansible AWX in the Inventory File

## Installing and Starting Ansible AWX with Ansible Playbook

You’ve configured Ansible AWX properly, and now it’s time to install it using an Ansible playbook (_install.yml_). The _install.yml_ Ansible playbook comes with the Ansible AWX package you extracted. This playbook contains tasks to execute commands to build a Docker image and run multiple containers.

1\. Invoke the [ansible-playbook](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html) command below to run the install.yml Ansible Playbook.

```bash
ansible-playbook -i inventory install.yml 
```

Below, you can see that some tasks have changed status, indicating the AWX host wasn’t in the proper state and was modified to run the command.

On the contrary, other tasks show an ok status instead, which indicates they don’t require any changes.

![Executing the Ansible Playbook (install.yml)](https://adamtheautomator.com/wp-content/uploads/2022/06/image-8.png)

Executing the Ansible Playbook (_install.yml_)

2\. Next, run the docker command below to list all available Docker containers.

```bash
docker ps
```

The output below shows the running containers (awx\_tasks, awx\_redis, awx\_web, and awx\_postgres), confirming that AWX is installed correctly.

![Verifying all Docker Containers](https://adamtheautomator.com/wp-content/uploads/2022/06/image-9.png)

Verifying all Docker Containers

3\. Finally, open your favorite browser and navigate to Ansible AWX (_https://AWX-HOST-IP:80)_. Be sure to replace _AWX-HOST-IP_ with your Ansible host’s IP address. You’ll see the Ansible AWX login page on your browser if all goes well, as shown below.

Provide your username (admin) and password (password), and click on Log in to access the Ansible AWX dashboard. These credentials are the ones you configured in the last step of the “Installing Dependencies and Configuring Ansible AWX” section.

> AWX _automatically installs a self-signed certificate for HTTPS communication which may require acceptance in your browser._

![Accessing the Ansible AWX Dashboard UI](https://adamtheautomator.com/wp-content/uploads/2022/06/image-10.png)

Accessing the Ansible AWX Dashboard UI

After logging in, your browser redirects to the AWX Dashboard, as shown below.

![Viewing the AWX Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/06/image-11.png)

Viewing the AWX Dashboard

## Creating and Managing Inventories

Now that you have access to the Ansible AWX dashboard feel free to work on task automation. In this tutorial, you’ll manage multiple Ansible components within Ansible AWX Dashboard. But first, you’ll have to create and manage [inventories](https://docs.ansible.com/ansible-tower/3.6.4/html/installandreference/glossary.html#term-Inventory).

1\. On the AWX Dashboard, click on Inventories to open the inventories list stored in the Ansible AWX. By default, a demo inventory is present, as shown below.

Ignore the demo inventory and click on the Add dropdown button to create a new inventory.

![Creating a New Inventory](https://adamtheautomator.com/wp-content/uploads/2022/06/image-12.png)

Creating a New Inventory

2\. Next, specify the below parameters on the Create new inventory page to configure your first inventory in Ansible AWX Dashboard:

*   **Name** – **ATA Learning** (You can provide the name as you like).
    
*   **Description** – Describe the inventory, which is optional but helps identify inventories, among many others.
    
*   **Organization** – Choose the Default option. AWX creates a default organization, but you can also create your own.
    

Once you specify all the above details, click on the save button as shown below.

![Creating an Inventory in the Ansible AWX Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/06/image-13.png)

Creating an Inventory in the Ansible AWX Dashboard

3\. Lastly, click on the Inventories tab (left panel) to verify the newly-created inventory (ATA Learning) exists, as shown below.

![Verifying the Inventory in the Ansible AWX Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/06/image-14.png)

Verifying the Inventory in the Ansible AWX Dashboard

## Creating and Running Ansible Jobs

You’ve successfully configured your inventory, but it’s useless right now unless you call it with a job. A job is an instance of AWX launching an Ansible playbook against a host’s inventory. And of course, before you can call a job, you first have to create one:

To create an Ansible and run an Ansible job:

1\. Create a YML file within the GitHub repository and copy/paste the below playbook. You can name the YML file as you like, but this tutorial uses the playbook called _ata.yml_.

Related:[How to Build (And Actually Understand) a Solid Ansible Playbook](https://adamtheautomator.com/ansible-playbook-example/)

```yaml
---
  - name: "Playing with Ansible."
# Ansible Playbook will run on the Localhost where AWX is installed
    hosts: localhost
    connection: local
    tasks:
# Below task will execute the list of directories and files present
    - name: "just execute a ls -lrt command"
      shell: "ls -lrt"
      register: "output"
# The Output of the above task will be displayed on the Screen
    - debug: var=output.stdout_lines
```

![Creating a YML File in the Git Repository](https://adamtheautomator.com/wp-content/uploads/2022/06/image-15.png)

Creating a YML File in the Git Repository

2\. Jump to your Ansible AWX dashboard, and click on Projects in the left panel to access the lists of available projects. You’ll need a project before you can create a job.

Ignore the Demo Project, and click on the Add button to create a new project.

![Initializing Adding a New Project](https://adamtheautomator.com/wp-content/uploads/2022/06/image-16.png)

Initializing Adding a New Project

3\. Provide the details of the new project with the following, and click on Save to save the new project:

*   **Name** – The project name can be anything you like, but this tutorial sets the project’s name to **myproject**.
    
*   **Description** – Like with your inventory, adding a description is optional but helps identify projects from one another.
    
*   **Organization** – Similar to your inventory, just choose **Default** for the organization.
    
*   **Source Control Credential Type** – Choose **Git** as your SCM.
    
*   **Sourced Control URL –** Specify your source code’s GitHub URL.
    

![Creating a New Project](https://adamtheautomator.com/wp-content/uploads/2022/06/image-17.png)

Creating a New Project

4\. After creating a project, click on Templates in the left sidebar to access all available templates, as shown below.

On the Templates page, click on the Add dropdown button, and choose the Add job template option to create a template.

![Creating a New Job Template](https://adamtheautomator.com/wp-content/uploads/2022/06/image-18.png)

Creating a New Job Template

5\. Now, specify the details below as follow, and click on Save at the bottom to save the new job template:

*   **Name** – Set the name of the job template as you like, but this tutorial sets the job template’s name to **myjob**.
    
*   **Job Type** – Set the action the job will take (**Run**).
    
*   **Project** – Choose the project you created in step three (**myproject**).
    
*   **Inventory** – Choose the inventory you created in step two of the “Creating and Managing Inventories” section (**ATA Learning**).
    
*   **Playbook** – Choose the playbook you created in step one of the “Creating and Running Ansible Jobs” section (ata.yml).
    

![Specifying Job Template Details](https://adamtheautomator.com/wp-content/uploads/2022/06/image-19.png)

Specifying Job Template Details

6\. Finally, on the Templates page, launch the newly-created job with the following:

*   Click on the job (**myjob**) to access the job’s information page.
    
*   Navigate to the **Details** tab, where you’ll see the job’s details.
    
*   Click on **Launch** at the bottom of the page to launch the job.
    

![Launching the Newly-created Job](https://adamtheautomator.com/wp-content/uploads/2022/06/image-20.png)

Launching the Newly-created Job

As you can see below, the Job ran successfully on localhost and listed all files within the directory specified in the playbook (_ata.yml_).

![Executing the Job Template](https://adamtheautomator.com/wp-content/uploads/2022/06/image-21.png)

Executing the Job Template

## Conclusion

In this tutorial, you’ve taken advantage of the Ansible AWX open-source tool to manage Ansible playbooks, inventories, and playbooks with a single UI Dashboard. You’ve touched on running an Ansible Job, such as listing files on a particular directory.

Now that you have sound knowledge of the Ansible AWX software, are you willing to run all of your future Ansible playbooks using Ansible AWX? Perhaps you’d want to automate tasks by adding cron jobs?

Related:[How To Execute and List Cron Jobs for a Linux System via PHP](https://adamtheautomator.com/list-cron-jobs/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fansible-awx%2F&text=Highly%20Effective%20Automation%20with%20Ansible%20AWX)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fansible-awx%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fansible-awx%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2021/04/A-Step-by-Step-Guide-to-Getting-Started-with-Ansible-on-Windows.jpg)

### [Mastering Ansible on Windows: Your Go-To Expert Guide](/ansible-on-windows/)

Ansible on Windows made simple. A complete guide to hassle-free installation and configuration, perfect for users seeking quick and effective mastery.

![](https://adamtheautomator.com/wp-content/uploads/2022/10/How-to-Manage-Python-Libraries-with-Ansible-Pip.jpg)

### [How to Manage Python Libraries with Ansible Pip](/ansible-pip/)

Learn how to effectively manage Python libraries with the Ansible Pip module and take control of your Python dependencies!

![](https://adamtheautomator.com/wp-content/uploads/2022/05/Efficient-Deployment-with-Ansible-Docker-Container.jpg)

### [Efficient Deployment with Ansible Docker Container](/ansible-docker-container/)

Learn to deploy and manage Ansible Docker containers efficiently with this real-world use case from ATA Learning!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
