# Execution Environments Setup Reference docs (latest)

**URL:** <https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532>\
**Category:** Project Discussions\
**Tags:** documentation, ee\
**Created:** [October 8, 2023, 7:32pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532 "2023-10-08T19:32:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [October 8, 2023, 7:32pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/1 "2023-10-08T19:32:08Z")

</div>

Hey there!

I was struggling for a while to get my custom EE built with `ansible-builder` v3.0.0, until I noticed that I was using an example from the official AAP 4.4 docs that is not working for me at all:

[https://docs.ansible.com/automation-controller/latest/html/userguide/ee\_reference.html#execution-environment-definition](https://docs.ansible.com/automation-controller/latest/html/userguide/ee_reference.html#execution-environment-definition)

More precisely, the example in section 16.1 says:

```yaml
---
version: 3

build_arg_defaults:
  ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--pre'

dependencies:
  galaxy: requirements.yml
  python:
    - six
    - psutil
  system: bindep.txt

images:
  base_image:
    name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel8:latest

additional_build_files:
    - src: files/ansible.cfg
      dest: configs

additional_build_steps:
  prepend_galaxy:
    - ADD _build/configs/ansible.cfg ~/.ansible.cfg

  prepend_final: |
    RUN whoami
    RUN cat /etc/os-release
  append_final:
    - RUN echo This is a post-install command!
    - RUN ls -la /etc

```

But this way, `ansible-builder` did not find the `~/.ansible.cfg` file on the EE image during the build, so it ended up switching to `/etc/ansible.cfg` (which obviously had not any of my customizations):

```auto
 ---> Running in 616ee7feb423
Using /etc/ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
ERROR! Failed to resolve the requested dependencies map. Could not satisfy the following requirements:

```

Finally, I fixed it by replacing `~./ansible.cfg` with `/home/runner/.ansible.cfg` on the `execution_environment.yml`, like this:

```auto
additional_build_steps:
  prepend_galaxy:
    - ADD _build/configs/ansible.cfg /home/runner/.ansible.cfg

```

So `~/.ansible.cfg` was found during the build:

```auto
 ---> Running in b52ce6947398
Using /home/runner/.ansible.cfg as config file
Starting galaxy collection install process
Process install dependency map
Starting collection install process

```

Now that I got my EE built & running, and before I blame the documentation for the struggle… Does anyone know if relative paths should be working when used on the `execution_environment.yml` file, or it’s just that the guide has this little -yet annoying- flaw, and instead of relative paths we should be using always absolute paths?

Cheers!

---

<div class="post-metadata">

**Author:** ![laurent-indermuehle](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/laurent-indermuehle/32/289_2.png) [@laurent-indermuehle](https://forum.ansible.com/u/laurent-indermuehle)\
**Post date:** [October 9, 2023, 7:06am UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/2 "2023-10-09T07:06:58Z")

</div>

I don’t recall which documentation I followed, but I notice a few differences with the one for AAP 2.4 (AAC 4.4) you linked:

```yaml
---
version: 3
[...]
additional_build_files:
  - src: ansible.cfg
    dest: configs

additional_build_steps:
  prepend_galaxy:
    - COPY _build/configs/ansible.cfg /etc/ansible/ansible.cfg

```

How `additional_build_files` and `addidtional_build_steps` interact is still a mystery to me.

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [October 9, 2023, 2:15pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/3 "2023-10-09T14:15:23Z")

</div>

[Use COPY not ADD in the builder examples · Issue #607 · ansible/ansible-builder · GitHub](https://github.com/ansible/ansible-builder/issues/607) suggests you’re correct that the docs should use COPY instead of ADD here. [This blog](https://www.ansible.com/blog/unlocking-efficiency-harnessing-the-capabilities-of-ansible-builder-3.0) also suggests any files added need to be relative to the location of the `execution-environment.yml` file.  
@Andersson007 @cidrblock - does this sound correct to you? We can get the various docs updated once we get a nod from you on this…

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [October 9, 2023, 2:19pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/4 "2023-10-09T14:19:10Z")

</div>

Thanks for researching further on this matter @samccann , I’ll take a closer look on the provided links myself. In the meantime let’s see what they say 🙂

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [October 9, 2023, 3:03pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/5 "2023-10-09T15:03:47Z")

</div>

ok if I read the docs further, it’s described at [Execution environment definition — Ansible Builder Documentation](https://ansible.readthedocs.io/projects/builder/en/latest/definition/#additional-build-files)

```auto
Specifies the source file(s) to copy into the build context directory. 
This may either be an absolute path (e.g., /home/user/.ansible.cfg), 
or a path that is relative to the execution environment file. 
Relative paths may be a glob expression matching one 
or more files (e.g. files/*.cfg). Note that an absolute path 
may not include a regular expression. 
If src is a directory, the entire contents of that directory are 
copied to dest.

```

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [October 9, 2023, 3:07pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/6 "2023-10-09T15:07:37Z")

</div>

…aaand I think I answered the wrong question there lol… now that I go back, the question was about the additional build steps…digging further

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [October 9, 2023, 3:15pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/7 "2023-10-09T15:15:22Z")

</div>

Okay this PR fixed the example in the builder docs, but we haven’t moved this update to the controller docs - [Update version 3 definition docs (#572) · ansible/ansible-builder@babf314 · GitHub](https://github.com/ansible/ansible-builder/commit/babf3145110ae36b2a6403f158308d980d32e095)

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [October 9, 2023, 4:02pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/8 "2023-10-09T16:02:49Z")

</div>

Wow that was efficient to say the least! Now I believe I could have dig further into the issue myself, so you hadn’t to do all the research. I’ll try to get more familiarised with all the docs & stuff regarding EE’s from now on… Anyway, thanks for your answers! I’m happy I could lend a hand also 😊

---

<div class="post-metadata">

**Author:** ![samccann](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/samccann/32/18_2.png) [@samccann](https://forum.ansible.com/u/samccann)\
**Post date:** [October 9, 2023, 4:12pm UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/9 "2023-10-09T16:12:25Z")

</div>

this thread helped us realize we weren’t in sync in various places so was very helpful, thanks!

---

<div class="post-metadata">

**Author:** ![Andersson007](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andersson007/32/89_2.png) [@Andersson007](https://forum.ansible.com/u/Andersson007)\
**Post date:** [October 11, 2023, 7:48am UTC](https://forum.ansible.com/t/execution-environments-setup-reference-docs-latest/1532/10 "2023-10-11T07:48:26Z")

</div>

Hello everyone,

@jbericat thanks for the issue!

1. I’ve just submitted a [PR against](https://github.com/ansible/awx/pull/14562) the controller doc to replace its definition related content with a reference to the same Builder doc. If someone already did it, sorry. @samccann could you please take a look? The replaced content is just a copy-paste of the Builder’s one.
2. Does anyone want to implement that easy fix issue Sandra created?

Thanks
