diff --git a/vmware-ee/ansible.cfg b/vmware-ee/ansible.cfg new file mode 100644 index 0000000..186432b --- /dev/null +++ b/vmware-ee/ansible.cfg @@ -0,0 +1,9 @@ +[galaxy] +server_list = automation_hub, release_galaxy + +[galaxy_server.automation_hub] +url=https://console.redhat.com/api/automation-hub/content/published/ +auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token + +[galaxy_server.release_galaxy] +url=https://galaxy.ansible.com/ diff --git a/vmware-ee/execution-environment.yml b/vmware-ee/execution-environment.yml index 9434af3..2417cfa 100644 --- a/vmware-ee/execution-environment.yml +++ b/vmware-ee/execution-environment.yml @@ -10,6 +10,11 @@ dependencies: python: requirements.txt system: bindep.txt +additional_build_files: + # Can be used to resolve collections from private automation hub + - src: ansible.cfg + dest: configs + # additional_build_steps: # append: # - RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/awscliv2.zip" @@ -17,3 +22,16 @@ dependencies: # - RUN /aws/aws/install # - RUN curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "/session-manager-plugin.rpm" # - RUN dnf install -y /session-manager-plugin.rpm + +additional_build_steps: + prepend_base: + - RUN $PYCMD -m pip install --upgrade pip setuptools + prepend_galaxy: + # Add custom ansible.cfg which defines collection install sources + - ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg + # AH_TOKEN is passed into the build command using a --build-arg + # accept this as an ARG during this stage to reference later + - ARG AH_TOKEN + # Use the above ARG to define an environment variable holding + # the token for resolving private collections + - ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=$AH_TOKEN