Skip to content

Commit 882363e

Browse files
authored
Merge pull request #47 from mhjacks/ansible_216
Update Ansible to 2.16 including other supporting changes for AGOF
2 parents daf9db4 + 19df1c1 commit 882363e

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

Containerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ ARG TKN_CLI_VERSION="0.35.2"
3232
ARG YQ_VERSION="4.40.7"
3333
ARG TEA_VERSION="0.9.2"
3434

35+
# As of 9/5/2024: awxkit is not compatible with python 3.12 due to setuptools
36+
# Ansible-core 2.16 is needed for losing track of async jobs (as noted in AGOF for infra.controller_configuration)
37+
# 'pip' will be influenced by where /usr/bin/python3 points, which we take care of with the altnernatives
38+
# command
39+
ARG PYTHON_VERSION="3.11"
40+
ARG PYTHON_PKGS="python${PYTHON_VERSION} python${PYTHON_VERSION}-pip python3-pip"
41+
ARG ANSIBLE_CORE_SPEC="ansible-core==2.16.*"
42+
3543
# amd64 - arm64
3644
ARG TARGETARCH
3745
# x86_64 - aarch64
@@ -43,7 +51,11 @@ ARG EXTRARPMS
4351

4452
USER root
4553

46-
RUN microdnf --disableplugin=subscription-manager install -y python3-pip python3-pytest make git-core tar vi jq which findutils diffutils sshpass $EXTRARPMS && \
54+
# 'pip' is expected to be the pip resolved by 'python3 pip' AKA the one we install with PYTHON_VERSION
55+
RUN microdnf --disableplugin=subscription-manager install -y ${PYTHON_PKGS} && microdnf --disableplugin=subscription-manager clean all
56+
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 0
57+
58+
RUN microdnf --disableplugin=subscription-manager install -y make git-core tar vi jq which findutils diffutils sshpass $EXTRARPMS && \
4759
microdnf remove -y $DNF_TO_REMOVE && \
4860
rpm -e --nodeps $RPM_TO_FORCEFULLY_REMOVE && \
4961
microdnf clean all && \
@@ -82,19 +94,17 @@ rm -rf /root/anaconda* /root/original-ks.cfg /usr/local/README
8294
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths
8395
# otherwise whatever user openshift runs the container with won't find the collection
8496

85-
RUN pip3 install --no-cache-dir "ansible-core>=2.9" kubernetes openshift "boto3>=1.21" "botocore>=1.24" "awscli>=1.22" "azure-cli>=2.34" gcloud humanize jmespath awxkit pytz --upgrade && \
86-
pip3 install --no-cache-dir ansible-runner git+https://github.com/validatedpatterns/vp-qe-test-common.git@development#egg=vp-qe-test-common --upgrade && \
87-
ansible-galaxy collection install --collections-path /usr/share/ansible/collections ansible.posix ansible.utils kubernetes.core community.okd redhat_cop.controller_configuration infra.controller_configuration community.general awx.awx amazon.aws && \
88-
rm -rf /usr/local/lib/python3.9/site-packages/ansible_collections/$COLLECTIONS_TO_REMOVE && \
97+
RUN pip install --no-cache-dir ${ANSIBLE_CORE_SPEC} pytest kubernetes openshift "boto3>=1.21" "botocore>=1.24" "awscli>=1.22" "azure-cli>=2.34" gcloud humanize jmespath awxkit pytz --upgrade && \
98+
pip install --no-cache-dir ansible-runner git+https://github.com/validatedpatterns/vp-qe-test-common.git@development#egg=vp-qe-test-common --upgrade && \
99+
ansible-galaxy collection install --collections-path /usr/share/ansible/collections ansible.posix ansible.utils kubernetes.core community.okd redhat_cop.controller_configuration infra.controller_configuration infra.eda_configuration infra.ah_configuration community.general awx.awx amazon.aws && \
100+
rm -rf /usr/local/lib/python${PYTHON_VERSION}/site-packages/ansible_collections/$COLLECTIONS_TO_REMOVE && \
89101
curl -L -O https://raw.githubusercontent.com/clumio-code/azure-sdk-trim/main/azure_sdk_trim/azure_sdk_trim.py && \
90-
python azure_sdk_trim.py && rm azure_sdk_trim.py && pip3 uninstall -y humanize && \
102+
python3 azure_sdk_trim.py && rm azure_sdk_trim.py && pip uninstall -y humanize && \
91103
if [ -n "$EXTRARPMS" ]; then microdnf remove -y $EXTRARPMS; fi && \
92104
mkdir -p /pattern/.ansible/tmp /pattern-home/.ansible/tmp && \
93105
find /pattern/.ansible -type d -exec chmod 770 "{}" \; && \
94106
find /pattern-home/.ansible -type d -exec chmod 770 "{}" \;
95107

96-
#RUN pip3 install --no-cache-dir ansible-runner
97-
98108
# We will have two important folders:
99109
# /pattern which will have the current pattern's git repo bindmounted
100110
# /pattern-home which stays inside the container only
@@ -104,6 +114,7 @@ find /pattern-home/.ansible -type d -exec chmod 770 "{}" \;
104114
#USER 1001
105115
ENV HOME=/pattern-home
106116
ENV ANSIBLE_REMOTE_TMP=/pattern-home/.ansible/tmp
117+
ENV ANSIBLE_ASYNC_DIR=/tmp/.ansible/.async
107118
ENV ANSIBLE_LOCAL_TMP=/pattern-home/.ansible/tmp
108119
ENV ANSIBLE_LOCALHOST_WARNING=False
109120

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TAG ?= latest
33
CONTAINER ?= $(NAME):$(TAG)
44

55
REGISTRY ?= localhost
6-
UPLOADREGISTRY ?= quay.io/rhn_support_mbaldess
6+
UPLOADREGISTRY ?= quay.io/hybridcloudpatterns
77
TESTCOMMAND := "set -e; echo '* Helm: '; helm version; \
88
echo '* ArgoCD: '; argocd version --client ; \
99
echo '* Tekton: '; tkn version ; \
@@ -14,6 +14,8 @@ TESTCOMMAND := "set -e; echo '* Helm: '; helm version; \
1414
echo '* kubernetes.core: '; ansible-galaxy collection list | grep kubernetes.core ; \
1515
echo '* redhat_cop.controller_configuration: '; ansible-galaxy collection list | grep redhat_cop.controller_configuration ; \
1616
echo '* infra.controller_configuration: '; ansible-galaxy collection list | grep infra.controller_configuration ; \
17+
echo '* infra.eda_configuration: '; ansible-galaxy collection list | grep infra.eda_configuration ; \
18+
echo '* infra.ah_configuration: '; ansible-galaxy collection list | grep infra.ah_configuration ; \
1719
echo '* awx.awx: '; ansible-galaxy collection list | grep awx.awx ; \
1820
echo '* community.general: '; ansible-galaxy collection list | grep community.general ; \
1921
echo '* ansible.posix: '; ansible-galaxy collection list | grep ansible.posix ; \
@@ -86,12 +88,11 @@ versions: ## Print all the versions of software in the locally-built container
8688
"set -e; \
8789
echo -n \"|sshpass package \"; rpm -q --queryformat '%{VERSION}' sshpass; echo \" \"; \
8890
echo -n \"|python3-pip package \"; rpm -q --queryformat '%{VERSION}' python3-pip; echo \" \"; \
89-
echo -n \"|python3-pytest package \"; rpm -q --queryformat '%{VERSION}' python3-pytest; echo \" \"; \
9091
echo -n \"|git-core package \"; rpm -q --qf '%{VERSION}' git-core; echo \" \"; \
9192
echo -n \"|vi package \"; rpm -q --qf '%{VERSION}' vim-minimal; echo \" \"; \
9293
echo -n \"|tar package \"; rpm -q --qf '%{VERSION}' tar; echo \" \"; \
9394
echo -n \"|make package \"; rpm -q --qf '%{VERSION}' make; echo \" \"; \
94-
echo -n \"|python package \"; rpm -q --qf '%{VERSION}' python3; echo \" \"; \
95+
echo -n \"|python package \"; /usr/bin/python3 --version | sed -e s'/Python //' | tr -d '\n'; echo \" \"; \
9596
echo -n \"|jq package \"; rpm -q --qf '%{VERSION}' jq; echo \" \"; \
9697
echo -n \"|argocd binary \"; argocd version --client -o json | jq -j '.client.Version'; echo \" \"; \
9798
echo -n \"|helm binary \"; helm version --template '{{ .Version }}'; echo \" \"; \
@@ -100,6 +101,7 @@ versions: ## Print all the versions of software in the locally-built container
100101
echo -n \"|openshift binary \"; oc version --client -o json | jq -j '.releaseClientVersion'; echo \" \"; \
101102
echo -n \"|kustomize binary \"; oc version --client -o json | jq -j '.kustomizeVersion'; echo \" \"; \
102103
echo -n \"|hcp binary \"; hcp --version version | cut -d: -f3 | tr -d '\n'; echo \" \"; \
104+
echo -n \"|pytest pip \"; pip show pytest | grep ^Version | cut -f2 -d\ |tr -d '\n'; echo \" \"; \
103105
echo -n \"|ansible pip \"; ansible --version -o json | grep core | cut -f3 -d\ | tr -d '\n]'; echo \" \"; \
104106
echo -n \"|kubernetes pip \"; pip show kubernetes |grep ^Version: | cut -f2 -d\ | tr -d '\n'; echo \" \"; \
105107
echo -n \"|boto3 pip \"; pip show boto3 | grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \
@@ -119,6 +121,8 @@ versions: ## Print all the versions of software in the locally-built container
119121
echo -n \"|ansible.utils collection \"; ansible-galaxy collection list ansible.utils |grep ^ansible.utils | cut -f2 -d\ |tr -d '\n'; echo \" \"; \
120122
echo -n \"|redhat_cop.controller_configuration collection \"; ansible-galaxy collection list redhat_cop.controller_configuration |grep ^redhat_cop.controller_configuration | cut -f2 -d\ | tr -d '\n'; echo \" \"; \
121123
echo -n \"|infra.controller_configuration collection \"; ansible-galaxy collection list infra.controller_configuration |grep ^infra.controller_configuration | cut -f2 -d\ | tr -d '\n'; echo \" \"; \
124+
echo -n \"|infra.eda_configuration collection \"; ansible-galaxy collection list infra.eda_configuration |grep ^infra.eda_configuration | cut -f2 -d\ | tr -d '\n'; echo \" \"; \
125+
echo -n \"|infra.ah_configuration collection \"; ansible-galaxy collection list infra.ah_configuration |grep ^infra.ah_configuration | cut -f2 -d\ | tr -d '\n'; echo \" \"; \
122126
" | sort | column --table -o '|'
123127

124128
.PHONY: run

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,36 @@ utility container for simplified execution of imperative commands in each of the
77

88
| name | type | version |
99
|:---------------------------------:|:--------:|:------------:|
10-
|ansible |pip |2.15.12 |
10+
|ansible |pip |2.16.10 |
1111
|ansible.posix |collection|1.5.4 |
1212
|ansible-runner |pip |2.4.0 |
13-
|ansible.utils |collection|5.1.0 |
13+
|ansible.utils |collection|5.1.1 |
1414
|argocd |binary |v2.9.7+fbb6b20|
15-
|awscli |pip |1.34.8 |
15+
|awscli |pip |1.34.13 |
1616
|awx.awx |collection|24.6.1 |
1717
|awxkit |pip |24.6.1 |
18-
|azure-cli |pip |2.63.0 |
19-
|boto3 |pip |1.35.8 |
20-
|botocore |pip |1.35.8 |
18+
|azure-cli |pip |2.64.0 |
19+
|boto3 |pip |1.35.13 |
20+
|botocore |pip |1.35.13 |
2121
|community.general |collection|9.3.0 |
2222
|community.okd |collection|4.0.0 |
2323
|gcloud |pip |0.18.3 |
2424
|git-core |package |2.43.5 |
2525
|hcp |binary |4.15.0 |
2626
|helm |binary |v3.13.3 |
27+
|infra.ah_configuration |collection|2.0.6 |
2728
|infra.controller_configuration |collection|2.9.0 |
29+
|infra.eda_configuration |collection|1.1.0 |
2830
|jmespath |pip |1.0.1 |
2931
|jq |package |1.6 |
3032
|kubernetes.core |collection|5.0.0 |
3133
|kubernetes |pip |30.1.0 |
3234
|kustomize |binary |v5.0.1 |
3335
|make |package |4.3 |
3436
|openshift |binary |4.14.20 |
37+
|pytest |pip |8.3.2 |
3538
|python3-pip |package |21.2.3 |
36-
|python3-pytest |package |6.2.2 |
37-
|python |package |3.9.18 |
39+
|python |package |3.11.7 |
3840
|redhat_cop.controller_configuration|collection|2.3.1 |
3941
|sshpass |package |1.09 |
4042
|tar |package |1.34 |

0 commit comments

Comments
 (0)