Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unixPB: Install Python2.7 on C6; Use it to install JDKs #1970

Merged
merged 3 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible/Dockerfile.CentOS6
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-Base.repo; \
./configure --enable-optimizations; \
make install; \
rm /usr/src/Python-3.6.10.tgz; \
pip3 install --upgrade pip; \
pip3 install ansible

COPY . /ansible
Expand Down
1 change: 1 addition & 0 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Version
- adopt_etc
- Common
- Python2.7 # CentOS6
- Providers # AdoptOpenJDK Infrastructure
- autoconf
- curl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
####################
# Python Bootstrap #
####################

# Check if Python is installed, and its version. If Python isn't installed, or it's at a version below 2.7.18, install Python 2.7.18.
# Currently only for CentOS6. See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1877

- name: Check for Python 2's version
shell: python -V 2>&1 | grep -Po '(?<=Python )(.+)'
register: python_version
ignore_errors: yes
when:
- (ansible_distribution == "CentOS") and (ansible_distribution_major_version == "6")
tags:
- python2.7

- name: Install Python2.7 to /usr/local/python2
unarchive:
src: https://ci.adoptopenjdk.net/userContent/usrlocalPython27.tar.xz
dest: /usr/local/
remote_src: yes
mode: 0755
retries: 3
delay: 5
register: python_download
until: python_download is not failed
when:
- (ansible_distribution == "CentOS") and (ansible_distribution_major_version == "6")
- (python_version.rc != 0) or (python_version.rc == 0 and python_version.stdout is version_compare('2.7.18', operator='lt'))
tags:
- python2.7
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,29 @@
until: adoptopenjdk_download is not failed
when:
- ansible_distribution != "MacOSX"
- not (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6")
- ansible_os_family != "Solaris"
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install

# CentOS6 needs it's own task so it can use a different python interpreter.
# See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1877
- name: Install latest release if not already installed (CentOS6)
unarchive:
src: https://api.adoptopenjdk.net/v3/binary/latest/{{ jdk_version }}/ga/linux/{{ api_architecture }}/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
dest: /usr/lib/jvm
remote_src: yes
vars:
- ansible_python_interpreter: /usr/local/python2/bin/python2.7
retries: 3
delay: 5
register: adoptopenjdk_download
until: adoptopenjdk_download is not failed
when:
- ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
- adoptopenjdk_installed.rc != 0
tags: adoptopenjdk_install

- name: Install latest release if one not already installed (macOS)
get_url:
url: https://api.adoptopenjdk.net/v3/installer/latest/{{ jdk_version }}/ga/mac/{{ api_architecture }}/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
Expand Down