Building an execution environment
To create an execution environment, we will need a definition file. There are three versions of the definition file, and based on the version of ansible-builder
, some versions might not be available to you. Let’s be more specific:
- Version 1: Supported by all
ansible-builder
versions - Version 2: Supported by
ansible-builder
versions 1.2 and higher - Version 3: Supported by
ansible-builder
versions 3.0 and higher
Since version 3 of the definition is the easiest to learn and use, all examples will use this version.
We will start with a minimal example and then build on it.
Creating a minimal execution environment
To create an execution environment, we need to create a YAML file. By default, ansible-builder
will be looking for the file named execution-environment.yml
. Although different names can be used and ansible-builder
can be informed using the -f FILENAME
flag, we will stick with the default name in this book.