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

push images to privatehub #906 #168

Open laurobmb opened 2 months ago

laurobmb commented 2 months ago

Summary

When I use the collection with the destination address ee_registry_dest: controller01.localnet.local:8444/lagomes pointing to an internal Automation Hub, the collection publishes the image, but in the Automation Hub only the destination username, in this case lagomes, is displayed, ignoring the image that was uploaded.

Issue Type

Ansible, Collection, Controller details

.ansible/collections/ansible_collections/infra/ee_utilities/roles/ee_builder/tasks/00_build_ee.yml

- name: Push image to registry
  containers.podman.podman_image:
    name: "{{ __execution_environment_definition.name }}"
    pull: false
    push: true
    username: "{{ ee_registry_username | default(omit, true) }}"
    password: "{{ ee_registry_password | default(omit, true) }}"
    auth_file: "{{ ee_auth_file | default(omit, true) }}"
    executable: "{{ ee_executable | default(omit, true) }}"
    ca_cert_dir: "{{ ee_ca_cert_dir | default(omit) }}"
    tag: "{{ __execution_environment_definition.tag | default(omit) }}"
    validate_certs: "{{ ee_validate_certs | default(omit) }}"
    push_args:
      dest: "{{ ee_registry_dest }}/{{ __execution_environment_definition.name }}"
      # dest: "{{ ee_registry_dest }}"
      sign_by: "{{ ee_sign_by | default(omit) }}"
  when: ee_image_push

When I forced the image name in the push_args.dest variable, it worked correctly. However, during testing, there was an issue when publishing to quay.io. In other words, I don't have problems publishing to quay.io, only when trying to publish to the private HUB.


ansible --version

ansible [core 2.16.10]
  config file = /home/lagomes/MEGA/ansible/ansible-as-a-code/infra_ee_utilities_example/ansible.cfg
  configured module search path = ['/home/lagomes/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/lagomes/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.5 (main, Aug 23 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

ansible-galaxy collection list
infra.ee_utilities                       3.1.3