I get a failure building a Docker image created using ansible-builder create
with the error below.
=> 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?