Skip to content

Commit 9b55b69

Browse files
Merge pull request #677 from splunk/python-ansible-upgrade
redhat8 py/ansible upgrade
2 parents 120bf34 + 57045ec commit 9b55b69

File tree

13 files changed

+29
-18
lines changed

13 files changed

+29
-18
lines changed

base/centos-7/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ rm -rf /etc/security/limits.d/20-nproc.conf
4747
# Clean
4848
yum clean all
4949
rm -rf /anaconda-post.log /var/log/anaconda/*
50+
51+
# symlink for python3
52+
ln -s /bin/python3 /bin/python
53+
ln -sf /usr/bin/pip3.7 /usr/bin/pip3

base/centos-8/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ echo "
4949

5050
# symlink for python3
5151
ln -s /bin/python3 /bin/python
52+
ln -sf /usr/bin/pip3.7 /usr/bin/pip3
5253

5354
# Clean
5455
yum clean all

base/debian-10/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ chmod u+s /bin/ping
9292
# Clean
9393
apt clean autoclean
9494
rm -rf /var/lib/apt/lists/*
95+
96+
# Symlink python/pip
97+
ln -sf /usr/bin/python3.7 /usr/bin/python3
98+
ln -sf /usr/bin/pip3.7 /usr/bin/pip3

base/debian-9/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@ chmod u+s /bin/ping
9393
# Clean
9494
apt clean autoclean
9595
rm -rf /var/lib/apt/lists/*
96+
97+
# Symlink python/pip
98+
ln -sf /usr/bin/python3.7 /usr/bin/python3
99+
ln -sf /usr/bin/pip3.7 /usr/bin/pip3

base/redhat-8/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ LABEL name="splunk" \
2828
ARG BUSYBOX_URL
2929

3030
ENV BUSYBOX_URL=${BUSYBOX_URL} \
31-
PYTHON_VERSION=3.7.16 \
32-
PYTHON_GPG_KEY_ID=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
31+
PYTHON_VERSION=3.9.19 \
32+
PYTHON_GPG_KEY_ID=E3FF2839C048B25C084DEBE9B26995E310250568
3333

3434
COPY install.sh /install.sh
3535

base/redhat-8/install.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ set -e
1717

1818
# Generate UTF-8 char map and locale
1919
# Reinstalling local English def for now, removed in minimal image: https://bugzilla.redhat.com/show_bug.cgi?id=1665251
20-
microdnf -y --nodocs install glibc-langpack-en
20+
# Comment below install until glibc update is available in minimal image: https://access.redhat.com/errata/RHSA-2024:2722
21+
#microdnf -y --nodocs install glibc-langpack-en
2122

2223
# Currently there is no access to the UTF-8 char map. The following command is commented out until
2324
# the base container can generate the locale.
@@ -71,10 +72,12 @@ make altinstall LDFLAGS="-Wl,--strip-all"
7172
rm -rf /tmp/pyinstall
7273
ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python
7374
ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
75+
ln -sf /usr/bin/python${PY_SHORT} /usr/bin/python3
76+
ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip3
7477

7578
# Install splunk-ansible dependencies
7679
cd /
77-
/usr/bin/python3.7 -m pip install --upgrade pip
80+
/usr/bin/python3.9 -m pip install --upgrade pip
7881
pip -q --no-cache-dir install --upgrade "requests_unixsocket<2.29" "requests<2.29" six wheel Mako "urllib3<2.0.0" certifi jmespath future avro cryptography lxml protobuf setuptools ansible
7982

8083
# Remove tests packaged in python libs

py23-image/centos-7/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
1717
&& python3.7 get-pip.py \
1818
&& rm -f get-pip.py \
1919
#pip version is not automatically "fixed", unlike debian-based
20-
&& ln -sf /usr/bin/pip2 /usr/bin/pip \
21-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3
20+
&& ln -sf /usr/bin/pip2 /usr/bin/pip
2221
RUN yum remove -y --setopt=tsflags=noscripts gcc openssl-devel bzip2-devel libffi-devel \
2322
&& yum autoremove -y \
2423
&& yum clean all

py23-image/centos-8/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ RUN wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz \
1818
&& python3.7 get-pip.py \
1919
&& rm -f get-pip.py \
2020
# pip version is not automatically "fixed", unlike debian-based
21-
&& ln -sf /usr/bin/pip2 /usr/bin/pip \
22-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3
21+
&& ln -sf /usr/bin/pip2 /usr/bin/pip
2322
# add python alias
2423
# && ln -s /bin/python3 /bin/python
2524

py23-image/debian-10/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ USER root
44

55
RUN apt-get update -y \
66
&& apt-get install -y --no-install-recommends libpython-dev python-pip python-requests python-jmespath python-yaml \
7-
&& ln -sf /usr/bin/python3.7 /usr/bin/python3 \
8-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \
97
&& ln -sf /usr/bin/python3.7 /usr/bin/python \
108
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip \
119
&& pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0

py23-image/debian-9/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ USER root
44

55
RUN apt-get update -y \
66
&& apt-get install -y --no-install-recommends libpython-dev python-pip python-requests python-jmespath python-yaml \
7-
&& ln -sf /usr/bin/python3.7 /usr/bin/python3 \
8-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \
97
&& ln -sf /usr/bin/python3.7 /usr/bin/python \
108
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip \
119
&& pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0

py23-image/redhat-8/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ FROM ${SPLUNK_PRODUCT}-redhat-8:latest
33
USER root
44

55
RUN microdnf -y --nodocs update \
6-
&& microdnf -y --nodocs install python2-pip python2-devel \
6+
&& microdnf -y --nodocs install python2 \
7+
&& pip2 install --upgrade pip \
78
&& pip2 --no-cache-dir install requests pyyaml jmespath \
8-
&& ln -sf /usr/bin/python3.7 /usr/bin/python3 \
9-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip3 \
10-
&& ln -sf /usr/bin/python3.7 /usr/bin/python \
11-
&& ln -sf /usr/bin/pip3.7 /usr/bin/pip \
12-
&& pip3 install --upgrade ansible==3.4.0 requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0
9+
&& ln -sf /usr/bin/python3.9 /usr/bin/python \
10+
&& ln -sf /usr/bin/pip3.9 /usr/bin/pip \
11+
&& pip3 install --upgrade requests==2.25.1 pyyaml==5.4.1 jmespath==0.10.0

splunk/common-files/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nans
112112
&& chgrp ${ANSIBLE_GROUP} ${SPLUNK_ANSIBLE_HOME} ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
113113
&& chmod 775 ${SPLUNK_ANSIBLE_HOME} \
114114
&& chmod 664 ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
115+
&& sed -i '/^\[defaults\]/a\interpreter_python = /usr/bin/python3' ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
115116
&& chmod 755 /sbin/entrypoint.sh /sbin/createdefaults.py /sbin/checkstate.sh
116117

117118
USER ${ANSIBLE_USER}

uf/common-files/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nans
105105
&& chgrp ${ANSIBLE_GROUP} ${SPLUNK_ANSIBLE_HOME} ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
106106
&& chmod 775 ${SPLUNK_ANSIBLE_HOME} \
107107
&& chmod 664 ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
108+
&& sed -i '/^\[defaults\]/a\interpreter_python = /usr/bin/python3' ${SPLUNK_ANSIBLE_HOME}/ansible.cfg \
108109
&& chmod 755 /sbin/entrypoint.sh /sbin/createdefaults.py /sbin/checkstate.sh
109110

110111
USER ${ANSIBLE_USER}

0 commit comments

Comments
 (0)