Skip to content

Commit 464553a

Browse files
authored
Merge pull request #83 from mbaldessari/update-ansible-community
Update ansible
2 parents d015c93 + be79b19 commit 464553a

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

Containerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ ARG YQ_VERSION="4.40.7"
3232
ARG TEA_VERSION="0.9.2"
3333

3434
# As of 9/5/2024: awxkit is not compatible with python 3.12 due to setuptools
35-
# Ansible-core 2.16 is needed for losing track of async jobs (as noted in AGOF for infra.controller_configuration)
35+
# Ansible-core 2.19 is needed for losing track of async jobs (as noted in AGOF for infra.controller_configuration)
3636
# 'pip' will be influenced by where /usr/bin/python3 points, which we take care of with the altnernatives
3737
# command
3838
ARG PYTHON_VERSION="3.11"
3939
ARG PYTHON_PKGS="python${PYTHON_VERSION} python${PYTHON_VERSION}-pip python3-pip"
40-
ARG ANSIBLE_CORE_SPEC="ansible-core==2.16.*"
4140

4241
# amd64 - arm64
4342
ARG TARGETARCH
@@ -118,9 +117,14 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
118117
# Add requirements.yml file for ansible collections
119118
COPY requirements.yml /tmp/requirements.yml
120119
COPY requirements.txt /tmp/requirements.txt
120+
COPY ansible-playbook-wrapper.sh /tmp/ansible-playbook-wrapper.sh
121121

122122
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
123123
ansible-galaxy collection install --collections-path /usr/share/ansible/collections -r /tmp/requirements.yml && \
124+
# Create ansible-playbook wrapper that sets ANSIBLE_STDOUT_CALLBACK to rhvp.cluster_utils.readable when it's "null" \
125+
mv /usr/local/bin/ansible-playbook /usr/local/bin/ansible-playbook.orig && \
126+
cp /tmp/ansible-playbook-wrapper.sh /usr/local/bin/ansible-playbook && \
127+
chmod +x /usr/local/bin/ansible-playbook && \
124128
rm -rf /usr/local/lib/python${PYTHON_VERSION}/site-packages/ansible_collections/$COLLECTIONS_TO_REMOVE && \
125129
curl -L -O https://raw.githubusercontent.com/clumio-code/azure-sdk-trim/main/azure_sdk_trim/azure_sdk_trim.py && \
126130
python3 azure_sdk_trim.py && rm azure_sdk_trim.py && pip uninstall -y humanize && \

ansible-playbook-wrapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Wrapper script for ansible-playbook that sets ANSIBLE_STDOUT_CALLBACK when needed
3+
if [ "${ANSIBLE_STDOUT_CALLBACK}" = "null" ]; then
4+
export ANSIBLE_STDOUT_CALLBACK="rhvp.cluster_utils.readable"
5+
fi
6+
export ANSIBLE_INVENTORY_UNPARSED_WARNING=False
7+
exec /usr/local/bin/ansible-playbook.orig "$@"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ansible-core==2.16.*
1+
ansible-core==2.19.*
22
ansible-runner
33
awxkit
44
kubernetes

0 commit comments

Comments
 (0)