Creating a custom EE for AWX

Ansible Execution Environment (EE) is used in AWX and Redhat Tower stack as the container that runs jobs or tasks. EE executes a virtual environment (venv) which runs in the task Pod/Container as shown below:

You can run into situations where you want to use certain ansible plugin which will require certain python dependencies and collections not included in the default EE, so you will have to create your own custom EE to include any extra dependencies needed.

Its actually fairly easy to create your custom ee, if you have the correct guide. So let’s start.

My build environment VM: 2 vCPU, 4GB ram, 60GB disk running Rocky-9.4. Please note my image buid process took about 25GB, so if you want to play around with multipe EE image build, then please have extra disk space.

Start by updating your OS and installing the requirements

You can check the ansible-builder version using following command

We need the following 4 files:

  • execution-environment.yml -> the main file which calls/includes the other 3 files.
    • requirements.yml -> list of collections you would like to include
    • requirements.txt -> any python/pip module requirements
    • bindep.txt -> OS requirements

Once all the above files are adjusted as per our requirements, we can start with create the build.

Tags you can change accordingly. The following command has two seperate tags.

The build can take 5min or so to complete. Once completed you will see similar output.

I created a free account on https://quay.io/ – for public repositories its free.

To push / upload a image you need a username/password. Its recommended you create a different password and encrypt. Please note repository username/password are different from web login credentials.

Once your credentials are ready, you can upload your image to repository.

Now we need to add a new Execution environment image on AWX. Log in to your AWX UI. Click on the “Execution Environments” option on the left-hand side of the AWX UI and Click on the “Add” button to create a new execution environment.

Enter the necessary details about your execution environment image, such as the name, image registry location, tag, and pull policy.

Now we can consume it via a Job Template

Run the job to see if its successful.


Comments

One response to “Creating a custom EE for AWX”

  1. […] If you don’t have a suitable EE environment then follow my tutorial/blog: creating-a-custom-ee-for-awx/ […]

Leave a Reply

Your email address will not be published. Required fields are marked *