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

podman_image *requires* namespace path in ee_registry_dest var #165

Open pcunning-rh opened 3 months ago

pcunning-rh commented 3 months ago

Summary

Changes in containers.podman:1.14.0 require images be pushed to a namespace. Using this collection, images cannot reside in the root of a PAH or Registry.

https://github.com/containers/ansible-podman-collections/blob/1.14.0/plugins/modules/podman_image.py#L801

The requirements.yml for this collection should either be version pinned to <1.14.0, or examples updated to indicate registry namespaces are required. However this is a breaking change for users and organizations not currently using registry namespaces for EEs.

Issue Type

Ansible, Collection, Docker/Podman details

ansible [core 2.15.12]
  config file = /runner/project/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.19 (main, May 16 2024, 08:45:40) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/bin/python3.9)
  jinja version = 3.1.4
  libyaml = True

# /runner/requirements_collections/ansible_collections
Collection                      Version
------------------------------- -------
ansible.controller              4.5.8  
containers.podman               1.15.4 
infra.ee_utilities              3.2.0  

podman version 4.9.4-rhel

OS / ENVIRONMENT

RHEL 8.10, AAP 2.4.7

Desired Behavior

EE Build Role should function as normal using this role with an image destination such as: pah.local/custom_ee:latest

Actual Behavior

Without specifying any additional registry destination paths/variables, error Destination must be a full URL or path to a directory.

TASK [infra.ee_utilities.ee_builder : Create ansible.cfg file if requested.] ***
changed: [node-1.{{ internal_cluster_fqdn }}.redhat.com]
TASK [infra.ee_utilities.ee_builder : Create EE definition file] ***************
changed: [node-1.{{ internal_cluster_fqdn }}.redhat.com]
TASK [infra.ee_utilities.ee_builder : Run the Ansible Builder Program] *********
changed: [node-1.{{ internal_cluster_fqdn }}.redhat.com]
TASK [infra.ee_utilities.ee_builder : Push image to registry] ******************
fatal: [node-1.{{ internal_cluster_fqdn }}.redhat.com]: FAILED! => {"changed": false, "msg": "Destination must be a full URL or path to a directory."}

STEPS TO REPRODUCE

Using default example from this repository.

  vars:
    # For controller configuration definition
    ee_builder_dir_clean: false
    builder_dir: .
    ee_update_base_images: false
    ee_reg_credential: Automation Hub Container Registry
    ee_base_image: node-2.{{ internal_cluster_fqdn }}.redhat.com/ee-minimal-rhel8
    ee_pull_collections_from_hub: true
    ah_host: node-2.{{ internal_cluster_fqdn }}.redhat.com
    ah_token: {{ token }}
    ee_registry_dest: node-2.{{ internal_cluster_fqdn }}.redhat.com
    ee_registry_username: {{ admin }}
    ee_registry_password: {{ pass }}
    ee_verbosity: 3
    ee_list:
      - name: custom_ee
        alt_name: Custom EE
        tag: 1-11-21-2
        dependencies:
          system:
            - python38-requests
            - python38-pyyaml
          python:
            - pytz # for schedule_rrule lookup plugin
            - python-dateutil>=2.7.0 # schedule_rrule
            - awxkit # For import and export modules
          galaxy:
            collections:
              - name: awx.awx
                version: 22.4.0
              - infra.controller_configuration
              - ansible.controller
              - infra.ah_configuration
        build_steps:
          prepend_final:
            - RUN whoami
            - RUN cat /etc/os-release
          append_final:
            - RUN echo This is a post-install command!
        images:
          base_image:
            name: node-2.{{ internal_cluster_fqdn }}.redhat.com/ee-minimal-rhel8:latest

To use the above vars with containers.podman > 1.13.0 you must change ee_registry_dest from:

ee_registry_dest: node-2.{{ internal_cluster_fqdn }}.redhat.com

to:

ee_registry_dest: node-2.{{ internal_cluster_fqdn }}.redhat.com/ees

... or any other repository/namespace other than ees