redhat-cop / ee_utilities

This ansible collection includes a number of roles and tools which can be useful for managing Ansible Execution Environments.
https://galaxy.ansible.com/infra/ee_utilities
GNU General Public License v3.0
57 stars 34 forks source link

ee_base_image not consistently overwritten by images: base_image: #147

Closed kpavon-silex closed 5 months ago

kpavon-silex commented 8 months ago

Summary

Documentation indicates that the

images:
  base_image:

section of an execution environment definition will override ee_base_image. This is true within execution_environment.yml.j2, but not within the task Pull builder images.

This results in a failure in the following circumstance:

In this situation, the Pull builder images task pulls the image as defined in vars/main.yml. However, since this doesn't match images: base_image:, the Run the Ansible Builder Program task may fail if a login is required to pull the image.

Issue Type

Desired Behavior

The base image should be pulled, respecting the ee_base_registry_username and ee_base_registry_password variables when needed.

Actual Behavior

"Error: creating build container: initializing source docker://registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest: unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication",

STEPS TO REPRODUCE

Suggested Resolution

Change the Pull builder images task from name: "{{ __execution_environment_definition.base_image | default(ee_base_image) }}" to name: "{{ __execution_environment_definition.images.base_image | default(__execution_environment_definition.base_image) | default(ee_base_image) }}"