Identify the automation execution environments provided by Red Hat and select the correct one for your use case.
An automation execution environment is a container image that includes Ansible Content Collections, their software dependencies, and a minimal Ansible engine that can run your playbooks.
By using an automation execution environment, you can use the same portable environment to develop your Ansible Playbooks on one system and run them on another. This streamlines and simplifies the development process and helps to ensure predictable, reproducible results.
The automation execution environment is where your Ansible Playbook runs.
You normally use a tool such as ansible-navigator to run a playbook, but the playbook runs inside the container rather than directly on your system.
An automation execution environment consists of the following components:
Ansible Core (or Ansible)
Ansible Content Collections to supplement Ansible Core
Python and any other dependencies of Ansible Core and the included collections
Ansible Runner to run your playbooks
Automation execution environments are prepared by the execution environment builder (ansible-builder), and can be pushed to any container registry.
A subsequent chapter covers how to create custom automation execution environments.
Red Hat Ansible Automation Platform 2.2 provides three prebuilt automation execution environments:
| Short name | Container image | Description |
|---|---|---|
| Minimal |
ee-minimal-rhel8
| A minimal automation execution environment based on Ansible Core 2.13. |
| Supported |
ee-supported-rhel8
| An automation execution environment based on Ansible Core 2.13 that includes Red Hat Ansible Certified Content Collections and their software dependencies. |
| Compatibility |
ee-29-rhel8
| An automation execution environment based on Ansible 2.9. |
The minimal automation execution environment only includes the ansible.builtin Ansible Content Collection.
You usually reserve it as a starting point to build custom automation execution environments.
The supported automation execution environment includes some collections that Red Hat supports. Automation content navigator and automation controller use the supported automation execution environment by default. Use this automation execution environment with your new playbooks.
The compatibility automation execution environment is based on Ansible 2.9, which was released before modules were unbundled from the core Ansible package into collections. This is useful when you want to run playbooks written for Ansible 2.9 (or Red Hat Ansible Automation Platform 1.2) that you have not yet migrated to Red Hat Ansible Automation Platform 2.
Red Hat hosts those three automation execution environments in its container registry at registry.redhat.io, under the ansible-automation-platform-22 namespace:
registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8:latest
registry.redhat.io/ansible-automation-platform-22/ee-supported-rhel8:latest
registry.redhat.io/ansible-automation-platform-22/ee-29-rhel8:latest
You can browse the registry catalog at https://catalog.redhat.com/software/containers/search?q=ansible-automation-platform-22.
Container images, such as automation execution environments, can have multiple tags that point to the same container image.
In the classroom environment, each of the three automation execution environments can be pulled from hub.lab.example.com using the latest tag.
Use automation content navigator to list and inspect the automation execution environments available on the system.
To do so, run the ansible-navigator images command:
[user@host ~]$ ansible-navigator images
Image Tag Execution environment Created Size
0│ee-29-rhel8 latest True 4 months ago 815 MB
1│ee-minimal-rhel8 latest True 4 months ago 265 MB
2│ee-supported-rhel8 latest True 4 months ago 1.05 GB
^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help helpYou can type the number of the automation execution environment that you want to inspect. For example, press 2 to review the details of the supported automation execution environment:
Image: ee-supported-rhel8:latest Description 0│Image information Information collected from image inspectio 1│General information OS and python version information 2│Ansible version and collections Information about ansible and ansible coll 3│Python packages Information about python and python packag 4│Operating system packages Information about operating system package 5│Everything All image information ^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help
You can view further details on a specific aspect of the automation execution environment by selecting the associated number.
In the preceding example, if you press 2 or enter :2, then you get the list of the available collections in that automation execution environment.
The ansible-navigator run command runs your playbooks in an automation execution environment.
This command uses the supported automation execution environment by default, but you can use the --execution-environment-image (or --eei) option to specify a different environment.
The following example shows how to run a playbook using the compatibility automation execution environment:
[user@host ~]$ansible-navigator run oldplaybook.yml --eei \>registry.redhat.io/ansible-automation-platform-22/ee-29-rhel8:latest
If the container image is already available on your system, then you can use its short image name: --eei ee-29-rhel8:latest in the preceding example.
If the container image is not already available on your system, ansible-navigator tries to pull it from the container registry.
Use the podman login command to ensure that you are authenticated to the registry.
In the preceding example, at the beginning of your session, run the podman login registry.redhat.io command and provide your Customer Portal credentials to authenticate to the registry.
You can control how ansible-navigator pulls container images by using the --pull-policy (or --pp) option with one of the following arguments:
| Option | Description |
|---|---|
always
| Always pulls the image. |
missing
| Only pulls the image if it is not already available locally. |
never
| Never pulls the image. |
tag
| Pulls the image if the image tag is latest or if it is not already available locally (the default). |
Instead of using the --eei option, you can create an ansible-navigator.yml configuration file to define the automation execution environment to use by default.
A later chapter describes that configuration file in more detail.