# Ansible-builder and galaxy-ng

**URL:** <https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669>\
**Category:** Get Help\
**Tags:** ansible-builder, galaxy-ng, ee\
**Created:** [October 12, 2023, 8:09am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669 "2023-10-12T08:09:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [October 12, 2023, 8:09am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/1 "2023-10-12T08:09:13Z")

</div>

I get a failure building a Docker image created using `ansible-builder create` with the error below.

```auto
 => ERROR [galaxy 5/5] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install -r requirements.yml --collections-path "/usr/share/ansible/collections" 3.5s
------                                                                                                                                                                                                                  
 > [galaxy 5/5] RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install -r requirements.yml --collections-path "/usr/share/ansible/collections":                                                     
1.970 Starting galaxy collection install process                                                                                                                                                                        
1.971 Process install dependency map                                                                                                                                                                                    
3.417 [WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an                                                                                                                                         
3.417 unexpected error when getting available versions of collection arista.eos: '/ap                                                                                                                                   
3.417 i/v3/plugin/ansible/content/published/collections/index/arista/eos/versions/'                                                                                                                                     
3.419 ERROR! Unexpected Exception, this is probably a bug: '/api/v3/plugin/ansible/content/published/collections/index/arista/eos/versions/'                                                                            
3.419 to see the full traceback, use -vvv                                                                                                                                                                               
------
Dockerfile:36
--------------------
  34 |     
  35 | RUN ansible-galaxy role install $ANSIBLE_GALAXY_CLI_ROLE_OPTS -r requirements.yml --roles-path "/usr/share/ansible/roles"
  36 | >>> RUN ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path "/usr/share/ansible/collections"
  37 |     
  38 | # Builder build stage
--------------------
ERROR: failed to solve: process "/bin/sh -c ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1 ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path \"/usr/share/ansible/collections\"" did not complete successfully: exit code: 250

```

However when I manually edit the Dockerfile, adding the line `ENV ANSIBLE_GALAXY_SERVER=https://old-galaxy.ansible.com/` above where `ansible-galaxy` is used to build in collections & roles, the error does not appear.

I am running this on a Mac with the following

- ansible-builder v3.0.0 installed with pip
- ansible-core 2.15.5 installed with brew
- python 3.11.6

I get the same behaviour if I remove ansible via brew and install ansible-core 2.13.13.

Should I pass an argument to `ansible-build create` to set the env var in the Dockerfile? Is it even possible to set arbitrary env vars in it?

---

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [October 12, 2023, 9:12am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/2 "2023-10-12T09:12:55Z")

</div>

I’ve found a way around the issue.

```auto
additional_build_steps:
  prepend_galaxy:
    - ENV ANSIBLE_GALAXY_SERVER="https://old-galaxy.ansible.com/"

```

---

<div class="post-metadata">

**Author:** ![fabeer](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/fabeer/32/7591_2.png) [@fabeer](https://forum.ansible.com/u/fabeer)\
**Post date:** [November 24, 2023, 5:50pm UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/3 "2023-11-24T17:50:27Z")

</div>

Hi,  
I want create a cusstom EE for using specifi collectopons  
This is my execution-environment.yml file

```auto
---
version: 1

dependencies:
  galaxy: requirements.yml

additional_build_steps:
  prepend_galaxy:
    - ENV ANSIBLE_GALAXY_SERVER="https://old-galaxy.ansible.com/"

```

but I have an error when i run

`ansible-builder build --tag=custom-bdi-awx-ee -t quay.io/ansible/awx-ee --container-runtime=docker --verbosity=3`

ansible\_builder.exceptions.DefinitionError: Keys (‘prepend\_galaxy’,) are not allowed in ‘additional\_build\_steps’.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 24, 2023, 7:12pm UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/4 "2023-11-24T19:12:58Z")

</div>

`prepend_galaxy` is part of the Version 3 format ([Execution Environment Definition — Ansible Builder Documentation](https://ansible.readthedocs.io/projects/builder/en/stable/definition/#version-3-format)). Your definition file states its Version 1.

---

<div class="post-metadata">

**Author:** ![fabeer](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/fabeer/32/7591_2.png) [@fabeer](https://forum.ansible.com/u/fabeer)\
**Post date:** [November 28, 2023, 9:57am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/7 "2023-11-28T09:57:08Z")

</div>

Thanks!  
Issue fixed after updating ansible-builder to version 3.0.0

---

<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:** [November 28, 2023, 10:28am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/8 "2023-11-28T10:28:58Z")

</div>

Hello,

Even though they seem related, looks like there are two different topics on the very same thread. @gwmngilfen would you be so kind to double-check if that’s the case and split this one into a separate thread on the get-help category, along with @felixfontein answer? Thanks! 🙂

---

<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:** [November 28, 2023, 10:32am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/9 "2023-11-28T10:32:01Z")

</div>

Hello @iamroddo!

Would you mind to tick the solved check on your own answer, please? This way this thread will appear as solved on the get-help category, so other community members can take advantage of it too. Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 28, 2023, 10:32am UTC](https://forum.ansible.com/t/ansible-builder-and-galaxy-ng/1669/10 "2023-12-28T10:32:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
