Get started with ansible-builder

Red Hat Enterprise Linux Logo

Welcome to the Ansible Builder and Execution Environments workshop. This hands-on lab teaches you how to create and customize Ansible Execution Environments (EEs) for use in Automation Controller and other Ansible Automation Platform components.

Workshop Overview

In this workshop, you will learn how to use Ansible Builder to define, build, and manage execution environments that contain the exact dependencies needed for your automation. You’ll also learn how Ansible Builder integrates with Automation Hub, Automation Controller, and private registries to streamline automation at scale.

What You’ll Learn

By the end of this workshop, you will be able to:

  • Understand the purpose and structure of Execution Environments

  • Build a custom EE using ansible-builder

  • Include additional Python and system dependencies

  • Reference private Automation Hub collections

  • Use build arguments to handle certificates and secure registries

  • Troubleshoot and optimize your EE build process

  • Push and use the resulting EE in Automation Controller

Workshop Modules

This workshop is organized into six progressive modules:

Module Title Focus Area

1

Introduction to Execution Environments

Understand the components and purpose of EEs

2

Using ansible-builder

Learn how to create and inspect the EE build context

3

Adding Dependencies

Add Python, system, and collection requirements

4

Working with Automation Hub

Connect to and pull collections from a private Hub

5

Handling Certificates and Auth

Secure your builds and handle cert validation

6

Publishing and Testing

Push your EE to a registry and use it in Controller

Lab Environment

Prerequisites

Before starting this workshop, ensure you have:

  • Basic understanding of Ansible concepts and playbooks

  • Familiarity with Automation Controller and Automation Hub

  • Access to the provided lab environment

Lab Access

The terminal window to your right is already logged into the lab environment as the devops user via SSH. All steps in this lab should be completed as the devops user.

You have access to the following components:

  • VS Code: Integrated environment for editing EE definition files

  • Ansible Builder: Installed and ready for use

  • Automation Hub: Private hub with certified and validated collections

  • Podman/Buildah: Container tools for building and running EEs

  • Automation Controller: Configured to consume built EEs

Getting Started

To begin the workshop:

  1. Open VS Code in your workspace

  2. Review the execution-environment.yml and supporting files

  3. Build your first EE using ansible-builder build

  4. Explore the build context and output logs to understand each layer

You can re-run your build with increasing verbosity using the -v option: ansible-builder build -v 3

This is useful for debugging missing dependencies, certificate issues, or Hub authentication problems.