diff --git a/Containerfile b/Containerfile index 97a05ae..59da24c 100644 --- a/Containerfile +++ b/Containerfile @@ -32,12 +32,11 @@ ARG YQ_VERSION="4.40.7" ARG TEA_VERSION="0.9.2" # As of 9/5/2024: awxkit is not compatible with python 3.12 due to setuptools -# Ansible-core 2.16 is needed for losing track of async jobs (as noted in AGOF for infra.controller_configuration) +# Ansible-core 2.19 is needed for losing track of async jobs (as noted in AGOF for infra.controller_configuration) # 'pip' will be influenced by where /usr/bin/python3 points, which we take care of with the altnernatives # command ARG PYTHON_VERSION="3.11" ARG PYTHON_PKGS="python${PYTHON_VERSION} python${PYTHON_VERSION}-pip python3-pip" -ARG ANSIBLE_CORE_SPEC="ansible-core==2.16.*" # amd64 - arm64 ARG TARGETARCH @@ -118,9 +117,14 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1 # Add requirements.yml file for ansible collections COPY requirements.yml /tmp/requirements.yml COPY requirements.txt /tmp/requirements.txt +COPY ansible-playbook-wrapper.sh /tmp/ansible-playbook-wrapper.sh RUN pip install --no-cache-dir -r /tmp/requirements.txt && \ ansible-galaxy collection install --collections-path /usr/share/ansible/collections -r /tmp/requirements.yml && \ +# Create ansible-playbook wrapper that sets ANSIBLE_STDOUT_CALLBACK to rhvp.cluster_utils.readable when it's "null" \ +mv /usr/local/bin/ansible-playbook /usr/local/bin/ansible-playbook.orig && \ +cp /tmp/ansible-playbook-wrapper.sh /usr/local/bin/ansible-playbook && \ +chmod +x /usr/local/bin/ansible-playbook && \ rm -rf /usr/local/lib/python${PYTHON_VERSION}/site-packages/ansible_collections/$COLLECTIONS_TO_REMOVE && \ curl -L -O https://raw.githubusercontent.com/clumio-code/azure-sdk-trim/main/azure_sdk_trim/azure_sdk_trim.py && \ python3 azure_sdk_trim.py && rm azure_sdk_trim.py && pip uninstall -y humanize && \ diff --git a/ansible-playbook-wrapper.sh b/ansible-playbook-wrapper.sh new file mode 100755 index 0000000..f4cdef0 --- /dev/null +++ b/ansible-playbook-wrapper.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Wrapper script for ansible-playbook that sets ANSIBLE_STDOUT_CALLBACK when needed +if [ "${ANSIBLE_STDOUT_CALLBACK}" = "null" ]; then + export ANSIBLE_STDOUT_CALLBACK="rhvp.cluster_utils.readable" +fi +export ANSIBLE_INVENTORY_UNPARSED_WARNING=False +exec /usr/local/bin/ansible-playbook.orig "$@" diff --git a/requirements.txt b/requirements.txt index 5014619..5b1fcad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ansible-core==2.16.* +ansible-core==2.19.* ansible-runner awxkit kubernetes