Feedback

Chat Icon

AWX in Action

Ansible Orchestration at Scale

Scale AWX Without Breaking It: Mesh, Hop Nodes, and Capacity Planning
44%

Execution Instances: Where Jobs Actually Run

Execution instances are machines that join an AWX cluster to help execute tasks. These can be physical servers or virtual machines that run Ansible playbooks and other tasks. The concept of execution instances is central to scaling and distributing workloads in a large or complex environment.

To increase job capacity, you can set up one or more standalone execution nodes to run alongside your Kubernetes deployment of AWX.

Execution Instances

Execution Instances

These standalone machines run independently and are not part of the AWX Kubernetes cluster. The control nodes and the execution nodes communicate over a Receptor link, which forms the automation mesh. Receptor carries job definitions out to the execution node and streams job events back. Execution nodes are registered in AWX with the instance type "execution", meaning their job is to launch the execution environment container with Podman and run the playbook against the managed nodes. They do not serve the web UI, the API, or the task scheduler. Those stay on the control nodes inside the cluster.

AWX execution flow

AWX execution flow

To add a new instance, follow these steps:

  • Go to Instances in the left-hand menu and click the Add button. Here we need to provide a hostname, a description, the listener port (if you want to configure a custom port), the instance type, and some optional configuration settings. To start, we'll add the host awx-2 as the instance.

  • Use the Hostname field to provide the private IP of the remote host awx-2. It is essential to use the IP address of the remote host, not the hostname. The hostname may not be resolvable by the control node unless you have a DNS server or a hosts file entry. For example, 10.10.1.2.

  • For the Listener port, we'll use 27199. This is the default port.

  • Choose Execution as the instance type. Enable Peers from control nodes. This allows the control nodes to peer with this instance automatically.

Add Execution Instance

Add Execution Instance

  • After adding the instance, you will see some details, including the Install Bundle. Download the bundle.

This bundle is a tarball that contains the plays and the inventory needed to configure and allow AWX to make proper TCP connections to the remote machine (awx-2). We're going to use our awx-1 to run the bundle on awx-2. First, we need to upload the bundle and extract it.

If you downloaded the bundle on your local machine, you need to upload it from there to awx-1. You can use scp:

# Export the downloaded file path
export BUNDLE_PATH=

# Rename the bundle to keep a consistent name after the upload
mv $BUNDLE_PATH /tmp/bundle.tar.gz

# Upload the bundle to the AWX instance
scp /tmp/bundle.tar.gz root@awx.example.com:/tmp

# Back to the AWX instance
ssh root@awx.example.com

# Extract the bundle
mkdir -p /tmp/bundle
cd /tmp
tar -xvf bundle.tar.gz -C /tmp/bundle --strip-components 1

Because we need to install the bundle's requirements using ansible-galaxy on the awx-2 machine, we need to install Ansible first. We'll use the EPEL repository to install Ansible:

# Update the package list
sudo dnf check-update

# Install Ansible
dnf install epel-release-9-7.el9 -y
dnf install ansible-7.7.0-1.el9 -y

Before running any playbook, we need to change the default inventory file that comes with the bundle. The default inventory file looks like this:

---
all:
  hosts:
    remote-execution:
      ansible_host

AWX in Action

Ansible Orchestration at Scale

Enroll now to unlock all content and receive all future updates for free.