---
version: 3
images:
  base_image:
    name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9:latest

dependencies:
  galaxy: requirements.yml

additional_build_files:
  # https://access.redhat.com/solutions/7024259
  # download from access.redhat.com -> Downloads -> OpenShift Container Platform -> Packages
  - src: openshift-clients-4.16.0-202408021139.p0.ge8fb3c0.assembly.stream.el9.x86_64.rpm
    dest: rpms
  - src: ansible.cfg
    dest: configs

options:
  package_manager_path: /usr/bin/microdnf

additional_build_steps:
  prepend_base:
    - RUN $PYCMD -m pip install --upgrade pip setuptools
    - COPY _build/rpms/openshift-clients*.rpm /tmp/openshift-clients.rpm
    - RUN $PKGMGR -y update && $PKGMGR -y install bash-completion && $PKGMGR clean all
    - RUN rpm -ivh /tmp/openshift-clients.rpm && rm /tmp/openshift-clients.rpm
  prepend_galaxy:
    - ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg
    - ARG ANSIBLE_GALAXY_SERVER_CERTIFIED_TOKEN
    - ARG ANSIBLE_GALAXY_SERVER_VALIDATED_TOKEN

...
