Questo contenuto non è disponibile nella lingua selezionata.

Chapter 3. Publishing an automation execution environment


3.1. Customizing an existing automation execution environments image

Ansible Controller includes three default execution environments:

  • Ansible 2.9 - no collections are installed other than Controller modules
  • Minimal - contains the latest Ansible 2.13 release along with Ansible Runner, but contains no collections or other additional content
  • EE Supported - Minimal, plus all Red Hat-supported collections and dependencies

While these environments cover many automation use cases, you can add additional items to customize these containers for your specific needs. The following procedure adds the kubernetes.core collection to the ee-minimal default image:

Procedure

  1. Log in to registry.redhat.io via Podman:

    $ podman login -u="[username]" -p="[token/hash]" registry.redhat.io
    Copy to Clipboard Toggle word wrap
  2. Ensure that you can pull the desired automation execution environment base image

    podman pull registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8:latest
    Copy to Clipboard Toggle word wrap
  3. Configure your Ansible Builder files to specify the desired base image and any additional content to add to the new execution environment image.

    1. For example, to add the Kubernetes Core Collection from Galaxy to the image, fill out the requirements.yml file as follows:

      collections:
        - kubernetes.core
      Copy to Clipboard Toggle word wrap
    2. For more information on definition files and their content, refer to to definition file breakdown section.
  4. In the execution environment definition file, specify the original ee-minimal container’s URL and tag in the EE_BASE_IMAGE field. In doing so, your final execution-environment.yml file will look like the following:

    Example 3.1. A customized execution-environment.yml file

    version: 1
    
    build_arg_defaults:
      EE_BASE_IMAGE: 'registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8:latest'
    
    dependencies:
      galaxy: requirements.yml
    Copy to Clipboard Toggle word wrap
    Note

    Since this example uses the community version of kubernetes.core and not a certified collection from automation hub, we do not need to create an ansible.cfg file or reference that in our definition file.

  5. Build the new execution environment image using the following command:

    $ ansible-builder build -t registry.redhat.io/[username]/new-ee
    Copy to Clipboard Toggle word wrap

    where [username] specifies your username, and new-ee specifies the name of your new container image.

Note

If you do not use -t with build, an image called ansible-execution-env is created and loaded into the local container registry.

  1. Use the podman images command to confirm that your new container image is in that list:

    Example 3.2. Output of a podman images command with the image new-ee

    REPOSITORY          TAG     IMAGE ID      CREATED        SIZE
    localhost/new-ee    latest  f5509587efbb  3 minutes ago  769 MB
    Copy to Clipboard Toggle word wrap
    1. Verify that the collection is installed:

      $ podman run registry.redhat.io/[username]/new-ee ansible-doc -l kubernetes.core
      Copy to Clipboard Toggle word wrap
    2. Tag the image for use in your automation hub:

      $ podman tag registry.redhat.io/[username]/new-ee [automation-hub-IP-address]/[username]/new-ee
      Copy to Clipboard Toggle word wrap
    3. Log in to your automation hub using Podman:

      Note

      You must have admin or appropriate container repository permissions for automation hub to push a container. See Managing containers in private automation hub in the Red Hat Ansible Automation Platform documentation for more information.

      $ podman login -u="[username]" -p="[token/hash]" [automation-hub-IP-address]
      Copy to Clipboard Toggle word wrap
    4. Push your image to the container registry in automation hub:

      $ podman push [automation-hub-IP-address]/[username]/new-ee
      Copy to Clipboard Toggle word wrap
    5. Pull your new image into your automation controller instance:
  2. Navigate to automation controller.
  3. From the side-navigational bar, click Administration Execution Environments.
  4. Click Add.
  5. Enter the appropriate information then click Save to pull in the new image.

    Note

    If your instance of automation hub is password or token protected, ensure that you have the appropriate container registry credential set up.

Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat