From 2fbae6382565b33b09e0f22258d08f09a74896da Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Wed, 9 Aug 2023 12:26:21 +0200 Subject: [PATCH 01/14] #210 - Migrate to Adoptium temurin --- .travis.yml | 18 +++--- molecule/temurin/Dockerfile.j2 | 15 +++++ molecule/temurin/converge.yml | 6 ++ molecule/temurin/molecule.yml | 30 +++++++++ molecule/temurin/tests/test_openjdk.yml | 16 +++++ molecule/temurin/verify.yml | 86 +++++++++++++++++++++++++ tasks/install_openjdk.yml | 7 +- vars/temurin/CentOS-8.yml | 14 ++++ vars/temurin/Debian-10.yml | 17 +++++ vars/temurin/Debian-11.yml | 17 +++++ 10 files changed, 216 insertions(+), 10 deletions(-) create mode 100644 molecule/temurin/Dockerfile.j2 create mode 100644 molecule/temurin/converge.yml create mode 100644 molecule/temurin/molecule.yml create mode 100644 molecule/temurin/tests/test_openjdk.yml create mode 100644 molecule/temurin/verify.yml create mode 100644 vars/temurin/CentOS-8.yml create mode 100644 vars/temurin/Debian-10.yml create mode 100644 vars/temurin/Debian-11.yml diff --git a/.travis.yml b/.travis.yml index 34671b4..cb7100e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,18 +14,18 @@ env: - secure: Iw1sHxmjqF6LPywwMPqbogZ47ZnSWPEDq8k71iqKfao0mDtLMUcmF2yIMLC0MQg1akaBKeHBS4MBQVBaGJDz++rgByzVpHwM0S0ZwUiO2ffVQE4uI+JSEMc1R34/5QPkYsg0FSIDVsCZZ9VnRLKh3GnVHlUljwwfVX5UX0g8RDEHxgdYSGGdAt8iUlQ3/YPSkvuKuNPWHtXCM0tkRYByUVUugSwUuo3rolYVv/S8AcrDf9qhHNkrp4zglC31wurq3M0yjmwHnShl+bLj2lV+QAenmFfjAZWlZ3DxARnSWSlFHMT3PGGWHYpFr2BN/na9ZQqmbWcR8k8XKFv6O205M+Zqao1zvzEpWVZBBiBJwYEVekQk1CzpVQ73sitYLHnmPNK5+W4939dNCkKocNhDf/bJTtaU/JlA64418N4hdjBsXTRfhzAILYJ0ba6a8Qnh5Xeuu3EZlRx6JepYEzy5dJel11MgDNVvaC8r9plCYtfo2ew1OH5QcDqCeaU+hTuXB02tNDWQoXP+aInF4JFqxWuEOlpGZeI3lXKNyHADaNBfziwWwtmBqHKhiLn7a8RJSSrVHRY0LS2YfAi5h4R3YwORlPr9E3I8Sgss21X1D2ocOMjZ4Qdfo5/eteUmEqq3yZBzeynrUwoSR7NYzllVWXMLMOoda2kckXNGaD5U7Es= jobs: # Java 8 - - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u292-b10-3 - DOCKER_TAG_TO_PUBLISH=8u292-bullseye-adoptopenjdk-headless - - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u292-b10-3 - DOCKER_TAG_TO_PUBLISH=8u292-buster-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 + DOCKER_TAG_TO_PUBLISH=8u382-bullseye-temurin-jdk + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 + DOCKER_TAG_TO_PUBLISH=8u382-buster-temurin-jdk - - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=8 JDK_VERSION=8u352-ga-1~18.04 - DOCKER_TAG_TO_PUBLISH=8u352-bionic-openjdk-headless - - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u352-ga-1~20.04 + - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=8 JDK_VERSION=8u372-ga~us1-0ubuntu1~18.04 + DOCKER_TAG_TO_PUBLISH=8u372-bionic-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u382-ga-1~20.04.1 DOCKER_TAG_TO_PUBLISH=8u342-focal-openjdk-headless - - DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 - JDK_VERSION=8u292_b10 DOCKER_TAG_TO_PUBLISH=8u292-centos8-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_VENDOR=temurin JDK_MAJOR=8 + JDK_VERSION=8.0.382.0.0+5 DOCKER_TAG_TO_PUBLISH=8u382-centos8-temurin-headless - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 DOCKER_TAG_TO_PUBLISH=8u302-bullseye-corretto-headless diff --git a/molecule/temurin/Dockerfile.j2 b/molecule/temurin/Dockerfile.j2 new file mode 100644 index 0000000..5dbc587 --- /dev/null +++ b/molecule/temurin/Dockerfile.j2 @@ -0,0 +1,15 @@ +# Molecule managed + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM {{ item.image }} +{% endif %} + +RUN mkdir -p /usr/share/man/man1 + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi diff --git a/molecule/temurin/converge.yml b/molecule/temurin/converge.yml new file mode 100644 index 0000000..f4d4971 --- /dev/null +++ b/molecule/temurin/converge.yml @@ -0,0 +1,6 @@ +--- + +- name: Converge + hosts: openjdk + roles: + - java_role diff --git a/molecule/temurin/molecule.yml b/molecule/temurin/molecule.yml new file mode 100644 index 0000000..31f8a58 --- /dev/null +++ b/molecule/temurin/molecule.yml @@ -0,0 +1,30 @@ +--- +dependency: + name: galaxy +driver: + name: docker + +lint: | + yamllint . + ansible-lint . + +platforms: + - name: temurin-test + groups: + - openjdk + image: ${DOCKER_IMAGE_BASE:-debian:buster-slim} + +provisioner: + name: ansible + inventory: + group_vars: + openjdk: + java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} + java_jdk_vendor: adoptopenjdk + java_open_jdk_version: ${JDK_VERSION} + java_open_jdk_version_major: ${JDK_MAJOR} + +scenario: + name: temurin +verifier: + name: ansible diff --git a/molecule/temurin/tests/test_openjdk.yml b/molecule/temurin/tests/test_openjdk.yml new file mode 100644 index 0000000..f79f094 --- /dev/null +++ b/molecule/temurin/tests/test_openjdk.yml @@ -0,0 +1,16 @@ +--- + +file: + {{ java_open_jdk_home }}/lib: + exists: true + filetype: directory +package: +{% if java_open_jdk_version is defined and java_open_jdk_version is not sameas None and java_open_jdk_version != "" %} + {{ java_open_jdk_package }}: + installed: true + versions: + - {{ java_open_jdk_version }} +{% else %} + {{ java_open_jdk_package }}: + installed: true +{% endif %} diff --git a/molecule/temurin/verify.yml b/molecule/temurin/verify.yml new file mode 100644 index 0000000..53d888f --- /dev/null +++ b/molecule/temurin/verify.yml @@ -0,0 +1,86 @@ +--- +# This is an example playbook to execute goss tests. +# Tests need distributed to the appropriate ansible host/groups +# prior to execution by `goss validate`. +# +# The goss ansible module is installed with molecule. The ANSIBLE_LIBRARY +# path is updated appropriately on `molecule verify`. + +# Details about ansible module: +# - https://github.com/indusbox/goss-ansible + +- name: Verify + hosts: all + vars: + goss_version: v0.3.16 + goss_sha256sum: 827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb + goss_arch: amd64 + goss_dst: /usr/local/bin/goss + goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" + goss_test_directory: /tmp + goss_format: documentation + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + + tasks: + - name: Set JDK Vendor + set_fact: + java_jdk_vendor: temurin + + - name: Gather OS specific variables + include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + + - name: Gather architecture specific variables + include_vars: "../../vars/architecture.yml" + + # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) + # Allowing to 'override' variables that are defined using include_vars + - name: Setting OS specific variables + set_fact: + java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" + java_open_jdk_version_major: "{{ java_open_jdk_version_major if java_open_jdk_version_major is defined and java_open_jdk_version_major is not sameas None and java_open_jdk_version_major else __java_open_jdk_version_major }}" # noqa 204 + + - name: Setting OS specific variables (II) + set_fact: + java_open_jdk_home_dir: "{{ java_open_jdk_home_dir if java_open_jdk_home_dir is defined and java_open_jdk_home_dir is not sameas None and java_open_jdk_home_dir else __java_open_jdk_home_dir }}" # noqa 204 + java_open_jdk_package: "{{ java_open_jdk_package if java_open_jdk_package is defined and java_open_jdk_package is not sameas None and java_open_jdk_package else __java_open_jdk_package }}" # noqa 204 + + - name: Setting specific variables + set_fact: + java_home: "{{ java_open_jdk_home }}" + + - name: Download and install goss + get_url: + url: "{{ goss_url }}" + dest: "{{ goss_dst }}" + mode: 0755 + + - name: Copy tests to remote + template: + src: "{{ item }}" + dest: "{{ goss_test_directory }}/{{ item | basename }}" + with_fileglob: + - "{{ playbook_dir }}/tests/test_*.yml" + + - name: Register test files + shell: "ls {{ goss_test_directory }}/test_*.yml" + register: test_files + changed_when: false + + - name: Execute Goss tests + command: "goss -g {{ item }} validate --format {{ goss_format }}" + register: test_results + with_items: "{{ test_files.stdout_lines }}" + ignore_errors: true + changed_when: false + + - name: Display details about the goss results + debug: + msg: "{{ item.stdout_lines }}" + with_items: "{{ test_results.results }}" + + - name: Fail when tests fail + fail: + msg: "Goss failed to validate" + when: item.rc != 0 + with_items: "{{ test_results.results }}" diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 5e4dc4b..6b70ab0 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -1,5 +1,11 @@ --- +- name: Java | Migrate adoptopenjdk to temurin (if selected) + set_fact: + java_jdk_vendor: "temurin" + when: "java_jdk_vendor == 'adoptopenjdk'" + + - name: Java | Gather OS specific variables include_vars: "{{ item }}" with_first_found: @@ -114,4 +120,3 @@ name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" when: ansible_os_family == 'Debian' - diff --git a/vars/temurin/CentOS-8.yml b/vars/temurin/CentOS-8.yml new file mode 100644 index 0000000..87951b1 --- /dev/null +++ b/vars/temurin/CentOS-8.yml @@ -0,0 +1,14 @@ +--- +java_open_jdk_apt_extra_packages: [] +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +__java_required_repositories_openjdk: + - { name: "Temurin", baseurl: "https://packages.adoptium.net/artifactory/rpm/centos/$releasever/$basearch" } +__java_required_libs_openjdk: [] +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk + +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk diff --git a/vars/temurin/Debian-10.yml b/vars/temurin/Debian-10.yml new file mode 100644 index 0000000..b0179b9 --- /dev/null +++ b/vars/temurin/Debian-10.yml @@ -0,0 +1,17 @@ +--- +java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +__java_required_libs_openjdk: [] + +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk diff --git a/vars/temurin/Debian-11.yml b/vars/temurin/Debian-11.yml new file mode 100644 index 0000000..0d3791b --- /dev/null +++ b/vars/temurin/Debian-11.yml @@ -0,0 +1,17 @@ +--- +java_open_jdk_apt_extra_packages: + - python3-apt + - apt-transport-https + - gnupg2 +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk From 6f9f1df2f9bcf4f2de0ae3972b8dd5ef9218c65c Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Thu, 10 Aug 2023 08:09:58 +0200 Subject: [PATCH 02/14] #210 - Migrate to Adoptium temurin --- .travis.yml | 2 +- vars/adoptopenjdk/CentOS-8.yml | 14 -------------- vars/adoptopenjdk/Debian-10.yml | 16 ---------------- vars/adoptopenjdk/Debian-11.yml | 18 ------------------ 4 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 vars/adoptopenjdk/CentOS-8.yml delete mode 100644 vars/adoptopenjdk/Debian-10.yml delete mode 100644 vars/adoptopenjdk/Debian-11.yml diff --git a/.travis.yml b/.travis.yml index cb7100e..00d3bac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ env: DOCKER_TAG_TO_PUBLISH=8u342-focal-openjdk-headless - DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_VENDOR=temurin JDK_MAJOR=8 - JDK_VERSION=8.0.382.0.0+5 DOCKER_TAG_TO_PUBLISH=8u382-centos8-temurin-headless + JDK_VERSION=8.0.332.0.0.9-1 DOCKER_TAG_TO_PUBLISH=8u332-centos8-temurin-headless - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 DOCKER_TAG_TO_PUBLISH=8u302-bullseye-corretto-headless diff --git a/vars/adoptopenjdk/CentOS-8.yml b/vars/adoptopenjdk/CentOS-8.yml deleted file mode 100644 index d85b0b8..0000000 --- a/vars/adoptopenjdk/CentOS-8.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: [] -__java_open_jdk_version_major: 8 -__java_keystore_dir: jre/lib/security -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -__java_required_repositories_openjdk: - - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } -__java_required_libs_openjdk: [] -__java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot - -__java_required_key_repositories_openjdk: - - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public -__java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot diff --git a/vars/adoptopenjdk/Debian-10.yml b/vars/adoptopenjdk/Debian-10.yml deleted file mode 100644 index 8506b3c..0000000 --- a/vars/adoptopenjdk/Debian-10.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: - - python-apt - - apt-transport-https -__java_open_jdk_version_major: 8 -__java_keystore_dir: jre/lib/security -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -# For Debian family -__java_required_libs_openjdk: [] -__java_required_repositories_openjdk: - - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main -__java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-{{ java_open_jdk_home_dir_suffix }} -__java_required_key_repositories_openjdk: - - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public -__java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot diff --git a/vars/adoptopenjdk/Debian-11.yml b/vars/adoptopenjdk/Debian-11.yml deleted file mode 100644 index d094df8..0000000 --- a/vars/adoptopenjdk/Debian-11.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: - - python3-apt - - apt-transport-https - - gnupg2 -__java_open_jdk_version_major: 8 -__java_keystore_dir: jre/lib/security -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -# For Debian family -__java_required_libs_openjdk: [] -__java_required_repositories_openjdk: - - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main -__java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-{{ java_open_jdk_home_dir_suffix }} - -__java_required_key_repositories_openjdk: - - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public -__java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot From 429c75ea17522b552bc2b00fda824f9b8261c1ad Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Thu, 10 Aug 2023 08:41:20 +0200 Subject: [PATCH 03/14] #210 - Migrate to Adoptium temurin. Fixing alternatives --- tasks/install_openjdk.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 6b70ab0..d99aa15 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -119,4 +119,11 @@ alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" - when: ansible_os_family == 'Debian' + when: "ansible_os_family == 'Debian' and java_open_jdk_version_major < '11'" + + +- name: Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" + alternatives: + name: java + path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" + when: "ansible_os_family == 'Debian' and java_open_jdk_version_major >= '11'" From a31b2efa1c3ecb29cb949695ff00a283a9ebace7 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Thu, 10 Aug 2023 09:37:13 +0200 Subject: [PATCH 04/14] #210 - Migrate to Adoptium temurin. More jobs using temurin --- .travis.yml | 8 ++++++++ tasks/install_openjdk.yml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00d3bac..cd589b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,11 @@ env: - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=11 JDK_VERSION=11.0.18+10-1~deb11u1 DOCKER_TAG_TO_PUBLISH=11.0.18-bullseye-openjdk-headless + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 + DOCKER_TAG_TO_PUBLISH=11.0.20-buster-temurin-jdk + - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 + DOCKER_TAG_TO_PUBLISH=11.0.20-bullseye-temurin-jdk + - DOCKER_IMAGE_BASE=ubuntu:bionic DOCKER_TAG_TO_PUBLISH=11-bionic-openjdk-headless - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=11 JDK_VERSION=11.0.17+8-1ubuntu2~18.04 DOCKER_TAG_TO_PUBLISH=11.0.17-bionic-openjdk-headless @@ -62,6 +67,9 @@ env: - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VERSION=17.0.6+10-1~deb11u1 DOCKER_TAG_TO_PUBLISH=17.0.6-bullseye-openjdk-headless + - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VENDOR=temurin JDK_VERSION=17.0.8.0.0+7 + DOCKER_TAG_TO_PUBLISH=17.0.8-bullseye-temurin-jdk + - DOCKER_IMAGE_BASE=ubuntu:focal DOCKER_TAG_TO_PUBLISH=17-focal-openjdk-headless - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=17 JDK_VERSION=17.0.5+8-2ubuntu1~20.04 DOCKER_TAG_TO_PUBLISH=17.0.5-focal-openjdk-headless diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index d99aa15..865b685 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -115,14 +115,14 @@ tags: - skip_ansible_lint -- name: Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" +- name: "Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java in java < 11" alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" when: "ansible_os_family == 'Debian' and java_open_jdk_version_major < '11'" -- name: Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" +- name: "Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java in java >= 11" alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" From e71a693f355ce212758294aecb775c32c7a5df81 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Thu, 10 Aug 2023 10:12:09 +0200 Subject: [PATCH 05/14] #210 - Migrate to Adoptium temurin. Remove centos in temurin --- .travis.yml | 3 --- vars/temurin/CentOS-8.yml | 14 -------------- 2 files changed, 17 deletions(-) delete mode 100644 vars/temurin/CentOS-8.yml diff --git a/.travis.yml b/.travis.yml index cd589b5..d6eb348 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,6 @@ env: - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u382-ga-1~20.04.1 DOCKER_TAG_TO_PUBLISH=8u342-focal-openjdk-headless - - DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_VENDOR=temurin JDK_MAJOR=8 - JDK_VERSION=8.0.332.0.0.9-1 DOCKER_TAG_TO_PUBLISH=8u332-centos8-temurin-headless - - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 DOCKER_TAG_TO_PUBLISH=8u302-bullseye-corretto-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 diff --git a/vars/temurin/CentOS-8.yml b/vars/temurin/CentOS-8.yml deleted file mode 100644 index 87951b1..0000000 --- a/vars/temurin/CentOS-8.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: [] -__java_open_jdk_version_major: 8 -__java_keystore_dir: jre/lib/security -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -__java_required_repositories_openjdk: - - { name: "Temurin", baseurl: "https://packages.adoptium.net/artifactory/rpm/centos/$releasever/$basearch" } -__java_required_libs_openjdk: [] -__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk - -__java_required_key_repositories_openjdk: - - https://packages.adoptium.net/artifactory/api/gpg/key/public -__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk From 1800edeee19116772bacb0bf81fa0209c3bef4ae Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Thu, 10 Aug 2023 10:12:21 +0200 Subject: [PATCH 06/14] #210 - Migrate to Adoptium temurin. Remove centos in temurin --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a047e8..0fed8c6 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ CentOS 7 | `11` (default) CentOS 8 | `1.8.0` CentOS 8 | `11` (default) -Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see vars/ in AdoptOpenJDK and Corretto directories). +Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see vars/ in AdoptOpenJDK/Temurin and Corretto directories). ### Adding certificates into Java's truststore From 669bd391ddad284b668cdec00235e4d8458fb8b2 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Fri, 11 Aug 2023 10:54:39 +0200 Subject: [PATCH 07/14] #210 - Migrate to Adoptium temurin. Fixed travis jobs, updated readme and ubuntu support added in temurin --- .travis.yml | 52 ++++++++++++++++++++++++++++++------- README.md | 7 +++-- meta/main.yml | 1 + vars/corretto/Debian-12.yml | 18 +++++++++++++ vars/openjdk/Debian-12.yml | 16 ++++++++++++ vars/temurin/Debian-12.yml | 17 ++++++++++++ vars/temurin/Ubuntu-20.yml | 16 ++++++++++++ vars/temurin/Ubuntu-22.yml | 16 ++++++++++++ 8 files changed, 131 insertions(+), 12 deletions(-) create mode 100644 vars/corretto/Debian-12.yml create mode 100644 vars/openjdk/Debian-12.yml create mode 100644 vars/temurin/Debian-12.yml create mode 100644 vars/temurin/Ubuntu-20.yml create mode 100644 vars/temurin/Ubuntu-22.yml diff --git a/.travis.yml b/.travis.yml index d6eb348..5e7ad27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ env: - secure: Iw1sHxmjqF6LPywwMPqbogZ47ZnSWPEDq8k71iqKfao0mDtLMUcmF2yIMLC0MQg1akaBKeHBS4MBQVBaGJDz++rgByzVpHwM0S0ZwUiO2ffVQE4uI+JSEMc1R34/5QPkYsg0FSIDVsCZZ9VnRLKh3GnVHlUljwwfVX5UX0g8RDEHxgdYSGGdAt8iUlQ3/YPSkvuKuNPWHtXCM0tkRYByUVUugSwUuo3rolYVv/S8AcrDf9qhHNkrp4zglC31wurq3M0yjmwHnShl+bLj2lV+QAenmFfjAZWlZ3DxARnSWSlFHMT3PGGWHYpFr2BN/na9ZQqmbWcR8k8XKFv6O205M+Zqao1zvzEpWVZBBiBJwYEVekQk1CzpVQ73sitYLHnmPNK5+W4939dNCkKocNhDf/bJTtaU/JlA64418N4hdjBsXTRfhzAILYJ0ba6a8Qnh5Xeuu3EZlRx6JepYEzy5dJel11MgDNVvaC8r9plCYtfo2ew1OH5QcDqCeaU+hTuXB02tNDWQoXP+aInF4JFqxWuEOlpGZeI3lXKNyHADaNBfziwWwtmBqHKhiLn7a8RJSSrVHRY0LS2YfAi5h4R3YwORlPr9E3I8Sgss21X1D2ocOMjZ4Qdfo5/eteUmEqq3yZBzeynrUwoSR7NYzllVWXMLMOoda2kckXNGaD5U7Es= jobs: # Java 8 + - DOCKER_IMAGE_BASE=debian:bookworm-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 + DOCKER_TAG_TO_PUBLISH=8u382-bookworm-temurin-jdk - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 DOCKER_TAG_TO_PUBLISH=8u382-bullseye-temurin-jdk - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 @@ -22,8 +24,17 @@ env: - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=8 JDK_VERSION=8u372-ga~us1-0ubuntu1~18.04 DOCKER_TAG_TO_PUBLISH=8u372-bionic-openjdk-headless - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u382-ga-1~20.04.1 - DOCKER_TAG_TO_PUBLISH=8u342-focal-openjdk-headless + DOCKER_TAG_TO_PUBLISH=8u382-focal-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_MAJOR=8 JDK_VERSION=8u382-ga-1~22.04.1 + DOCKER_TAG_TO_PUBLISH=8u382-jammy-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 + DOCKER_TAG_TO_PUBLISH=8u382-focal-temurin-jdk + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 + DOCKER_TAG_TO_PUBLISH=8u382-jammy-temurin-jdk + + - DOCKER_IMAGE_BASE=debian:bookworm-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 + DOCKER_TAG_TO_PUBLISH=8u302-bookworm-corretto-headless - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 DOCKER_TAG_TO_PUBLISH=8u302-bullseye-corretto-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.302.08-1 @@ -38,19 +49,29 @@ env: - DOCKER_IMAGE_BASE=debian:bullseye-slim DOCKER_TAG_TO_PUBLISH=11-bullseye-openjdk-headless - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=11 JDK_VERSION=11.0.18+10-1~deb11u1 DOCKER_TAG_TO_PUBLISH=11.0.18-bullseye-openjdk-headless + - DOCKER_IMAGE_BASE=debian:bookworm-slim DOCKER_TAG_TO_PUBLISH=11-bookworm-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 DOCKER_TAG_TO_PUBLISH=11.0.20-buster-temurin-jdk - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 DOCKER_TAG_TO_PUBLISH=11.0.20-bullseye-temurin-jdk + - DOCKER_IMAGE_BASE=debian:bookworm-slim JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 + DOCKER_TAG_TO_PUBLISH=11.0.20-bookworm-temurin-jdk - DOCKER_IMAGE_BASE=ubuntu:bionic DOCKER_TAG_TO_PUBLISH=11-bionic-openjdk-headless - - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=11 JDK_VERSION=11.0.17+8-1ubuntu2~18.04 - DOCKER_TAG_TO_PUBLISH=11.0.17-bionic-openjdk-headless - + - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=11 JDK_VERSION=11.0.19+7~us1-0ubuntu1~18.04.1 + DOCKER_TAG_TO_PUBLISH=11.0.19-bionic-openjdk-headless - DOCKER_IMAGE_BASE=ubuntu:focal DOCKER_TAG_TO_PUBLISH=11-focal-openjdk-headless - - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=11 JDK_VERSION=11.0.17+8-1ubuntu2~20.04 - DOCKER_TAG_TO_PUBLISH=11.0.17-focal-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=11 JDK_VERSION=11.0.20+8-1ubuntu1~20.04 + DOCKER_TAG_TO_PUBLISH=11.0.20-focal-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:jammy DOCKER_TAG_TO_PUBLISH=11-jammy-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_MAJOR=11 JDK_VERSION=11.0.20+8-1ubuntu1~22.04 + DOCKER_TAG_TO_PUBLISH=11.0.20-jammy-openjdk-headless + + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 + DOCKER_TAG_TO_PUBLISH=11.0.20-focal-temurin-jdk + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_MAJOR=11 JDK_VENDOR=temurin JDK_VERSION=11.0.20.0.0+8 + DOCKER_TAG_TO_PUBLISH=11.0.20-jammy-temurin-jdk - DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.12.0.7 DOCKER_TAG_TO_PUBLISH=11.0.12.0.7-centos7-openjdk-headless - DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_MAJOR=11 JDK_VERSION=11.0.13.0.8 @@ -61,15 +82,26 @@ env: # Java 17 - DOCKER_IMAGE_BASE=debian:bullseye-slim DOCKER_TAG_TO_PUBLISH=17-bullseye-openjdk-headless - - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VERSION=17.0.6+10-1~deb11u1 - DOCKER_TAG_TO_PUBLISH=17.0.6-bullseye-openjdk-headless + - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VERSION=17.0.7+7-1~deb11u1 + DOCKER_TAG_TO_PUBLISH=17.0.7-bullseye-openjdk-headless + - DOCKER_IMAGE_BASE=debian:bookworm-slim JDK_MAJOR=17 JDK_VERSION=17.0.8+7-1~deb12u1 + DOCKER_TAG_TO_PUBLISH=17.0.8-bookworm-openjdk-headless - DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VENDOR=temurin JDK_VERSION=17.0.8.0.0+7 DOCKER_TAG_TO_PUBLISH=17.0.8-bullseye-temurin-jdk + - DOCKER_IMAGE_BASE=debian:bookworm-slim JDK_MAJOR=17 JDK_VENDOR=temurin JDK_VERSION=17.0.8.0.0+7 + DOCKER_TAG_TO_PUBLISH=17.0.8-bookworm-temurin-jdk - DOCKER_IMAGE_BASE=ubuntu:focal DOCKER_TAG_TO_PUBLISH=17-focal-openjdk-headless - - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=17 JDK_VERSION=17.0.5+8-2ubuntu1~20.04 - DOCKER_TAG_TO_PUBLISH=17.0.5-focal-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=17 JDK_VERSION=17.0.8+7-1~20.04.2 + DOCKER_TAG_TO_PUBLISH=17.0.8-focal-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:jammy DOCKER_TAG_TO_PUBLISH=17-jammy-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_MAJOR=17 JDK_VERSION=17.0.8+7-1~22.04 + DOCKER_TAG_TO_PUBLISH=17.0.8-jammy-openjdk-headless + - DOCKER_IMAGE_BASE=ubuntu:focal JDK_MAJOR=17 JDK_VENDOR=temurin JDK_VERSION=17.0.8.0.0+7 + DOCKER_TAG_TO_PUBLISH=17.0.8-focal-temurin-jdk + - DOCKER_IMAGE_BASE=ubuntu:jammy JDK_MAJOR=17 JDK_VENDOR=temurin JDK_VERSION=17.0.8.0.0+7 + DOCKER_TAG_TO_PUBLISH=17.0.8-jammy-temurin-jdk script: - pipenv run molecule test --scenario-name=${JDK_VENDOR:-default} diff --git a/README.md b/README.md index 0fed8c6..93ecd61 100644 --- a/README.md +++ b/README.md @@ -108,14 +108,17 @@ Debian Stretch | `11` Debian Buster | `11` (default) Debian Bullseye | `17` Debian Bullseye | `11` (default) +Debian Bookworm | `17` +Debian Bookworm | `17` (default) Ubuntu Xenial | `8` Ubuntu Xenial | `9` (default) Ubuntu Bionic | `8` Ubuntu Bionic | `11` (default) Ubuntu Focal | `8` Ubuntu Focal | `11` -Ubuntu Focal | `13` -Ubuntu Focal | `14` (default) +Ubuntu Focal | `17` (default) +Ubuntu Jammy | `11` +Ubuntu Jammy | `17` (default) CentOS 7 | `1.6.0` CentOS 7 | `1.7.0` CentOS 7 | `1.8.0` diff --git a/meta/main.yml b/meta/main.yml index 09ffef9..3a0be8a 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,6 +11,7 @@ galaxy_info: versions: - buster - bullseye + - bookworm - name: Ubuntu versions: - bionic diff --git a/vars/corretto/Debian-12.yml b/vars/corretto/Debian-12.yml new file mode 100644 index 0000000..737ceca --- /dev/null +++ b/vars/corretto/Debian-12.yml @@ -0,0 +1,18 @@ +--- +java_open_jdk_apt_extra_packages: + - python3-apt + - apt-transport-https + - gnupg2 + +__java_open_jdk_version_major: 1.8.0 +__java_keystore_dir: jre/lib/security +# Supported versions: 8 (1.8.0L), 11 + +__java_required_repositories_openjdk: + - deb https://apt.corretto.aws stable main +__java_required_key_repositories_openjdk: + - https://apt.corretto.aws/corretto.key +__java_required_libs_openjdk: [] +__java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk + +__java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto diff --git a/vars/openjdk/Debian-12.yml b/vars/openjdk/Debian-12.yml new file mode 100644 index 0000000..417e216 --- /dev/null +++ b/vars/openjdk/Debian-12.yml @@ -0,0 +1,16 @@ +--- + +# Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) +__java_open_jdk_version_major: 17 +__java_keystore_dir: lib/security +# Supported openjdk major releases: 11, 17 + +__java_required_repositories_openjdk: [] +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: [] +__java_open_jdk_apt_extra_packages: [] + +__java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless +__java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} + +ansible_python_interpreter: /usr/bin/python3 diff --git a/vars/temurin/Debian-12.yml b/vars/temurin/Debian-12.yml new file mode 100644 index 0000000..0d3791b --- /dev/null +++ b/vars/temurin/Debian-12.yml @@ -0,0 +1,17 @@ +--- +java_open_jdk_apt_extra_packages: + - python3-apt + - apt-transport-https + - gnupg2 +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk diff --git a/vars/temurin/Ubuntu-20.yml b/vars/temurin/Ubuntu-20.yml new file mode 100644 index 0000000..41aa7ed --- /dev/null +++ b/vars/temurin/Ubuntu-20.yml @@ -0,0 +1,16 @@ +--- +java_open_jdk_apt_extra_packages: + - python3-apt + - apt-transport-https + - gnupg2 +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk diff --git a/vars/temurin/Ubuntu-22.yml b/vars/temurin/Ubuntu-22.yml new file mode 100644 index 0000000..41aa7ed --- /dev/null +++ b/vars/temurin/Ubuntu-22.yml @@ -0,0 +1,16 @@ +--- +java_open_jdk_apt_extra_packages: + - python3-apt + - apt-transport-https + - gnupg2 +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk From 7d106da5dcb3b1dd0c38fff08a21d05618cc18da Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Fri, 11 Aug 2023 11:22:19 +0200 Subject: [PATCH 08/14] #210 - Migrate to Adoptium temurin. Changed travis dist --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e7ad27..b0d1681 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: jammy language: python python: 3.9 sudo: required From cc8abf76af9b098e703a9a8439a7e57985605e63 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Fri, 11 Aug 2023 14:19:43 +0200 Subject: [PATCH 09/14] #210 - Migrate to Adoptium temurin. Changelog :) --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdc6e0..0d3e23f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) +### Added +- *[#210](https://github.com/idealista/java_role/issues/210) Temurin support* @sorobon +- *[#210](https://github.com/idealista/java_role/issues/210) Debian 12 support* @sorobon +### Removed +- *[#210](https://github.com/idealista/java_role/issues/210) Removed adoptopenjdk* @sorobon ## [8.1.0](https://github.com/idealista/java_role/tree/8.1.0) (2023-06-22) ### Added From 33de969c00a05feed1f7301e71b368db406ee24c Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Mon, 14 Aug 2023 11:31:18 +0200 Subject: [PATCH 10/14] #210 - Migrate to Adoptium temurin. Added stretch support --- .travis.yml | 4 + meta/main.yml | 1 + molecule/adoptopenjdk/Dockerfile.j2 | 15 ---- molecule/adoptopenjdk/converge.yml | 6 -- molecule/adoptopenjdk/molecule.yml | 30 ------- molecule/adoptopenjdk/tests/test_openjdk.yml | 16 ---- molecule/adoptopenjdk/verify.yml | 86 -------------------- molecule/default/Dockerfile.j2 | 12 +++ molecule/temurin/Dockerfile.j2 | 12 +++ vars/openjdk/Debian-9.yml | 13 +++ vars/temurin/Debian-9.yml | 17 ++++ 11 files changed, 59 insertions(+), 153 deletions(-) delete mode 100644 molecule/adoptopenjdk/Dockerfile.j2 delete mode 100644 molecule/adoptopenjdk/converge.yml delete mode 100644 molecule/adoptopenjdk/molecule.yml delete mode 100644 molecule/adoptopenjdk/tests/test_openjdk.yml delete mode 100644 molecule/adoptopenjdk/verify.yml create mode 100644 vars/openjdk/Debian-9.yml create mode 100644 vars/temurin/Debian-9.yml diff --git a/.travis.yml b/.travis.yml index b0d1681..d7bd19f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,10 @@ env: DOCKER_TAG_TO_PUBLISH=8u382-bullseye-temurin-jdk - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.382.0.0+5 DOCKER_TAG_TO_PUBLISH=8u382-buster-temurin-jdk + - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_VENDOR=temurin JDK_MAJOR=8 JDK_VERSION=8.0.322.0.0+6-1 + DOCKER_TAG_TO_PUBLISH=8u322-buster-temurin-jdk + + - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=8 DOCKER_TAG_TO_PUBLISH=8-stretch-openjdk-headless - DOCKER_IMAGE_BASE=ubuntu:bionic JDK_MAJOR=8 JDK_VERSION=8u372-ga~us1-0ubuntu1~18.04 DOCKER_TAG_TO_PUBLISH=8u372-bionic-openjdk-headless diff --git a/meta/main.yml b/meta/main.yml index 3a0be8a..fc57d5e 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,6 +9,7 @@ galaxy_info: platforms: - name: Debian versions: + - stretch - buster - bullseye - bookworm diff --git a/molecule/adoptopenjdk/Dockerfile.j2 b/molecule/adoptopenjdk/Dockerfile.j2 deleted file mode 100644 index 5dbc587..0000000 --- a/molecule/adoptopenjdk/Dockerfile.j2 +++ /dev/null @@ -1,15 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -RUN mkdir -p /usr/share/man/man1 - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash ca-certificates && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi diff --git a/molecule/adoptopenjdk/converge.yml b/molecule/adoptopenjdk/converge.yml deleted file mode 100644 index f4d4971..0000000 --- a/molecule/adoptopenjdk/converge.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- name: Converge - hosts: openjdk - roles: - - java_role diff --git a/molecule/adoptopenjdk/molecule.yml b/molecule/adoptopenjdk/molecule.yml deleted file mode 100644 index 7251d4c..0000000 --- a/molecule/adoptopenjdk/molecule.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker - -lint: | - yamllint . - ansible-lint . - -platforms: - - name: openjdk-adopt-test - groups: - - openjdk - image: ${DOCKER_IMAGE_BASE:-debian:buster-slim} - -provisioner: - name: ansible - inventory: - group_vars: - openjdk: - java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} - java_jdk_vendor: adoptopenjdk - java_open_jdk_version: ${JDK_VERSION} - java_open_jdk_version_major: ${JDK_MAJOR} - -scenario: - name: adoptopenjdk -verifier: - name: ansible diff --git a/molecule/adoptopenjdk/tests/test_openjdk.yml b/molecule/adoptopenjdk/tests/test_openjdk.yml deleted file mode 100644 index f79f094..0000000 --- a/molecule/adoptopenjdk/tests/test_openjdk.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- - -file: - {{ java_open_jdk_home }}/lib: - exists: true - filetype: directory -package: -{% if java_open_jdk_version is defined and java_open_jdk_version is not sameas None and java_open_jdk_version != "" %} - {{ java_open_jdk_package }}: - installed: true - versions: - - {{ java_open_jdk_version }} -{% else %} - {{ java_open_jdk_package }}: - installed: true -{% endif %} diff --git a/molecule/adoptopenjdk/verify.yml b/molecule/adoptopenjdk/verify.yml deleted file mode 100644 index 6dc75cd..0000000 --- a/molecule/adoptopenjdk/verify.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -# This is an example playbook to execute goss tests. -# Tests need distributed to the appropriate ansible host/groups -# prior to execution by `goss validate`. -# -# The goss ansible module is installed with molecule. The ANSIBLE_LIBRARY -# path is updated appropriately on `molecule verify`. - -# Details about ansible module: -# - https://github.com/indusbox/goss-ansible - -- name: Verify - hosts: all - vars: - goss_version: v0.3.16 - goss_sha256sum: 827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb - goss_arch: amd64 - goss_dst: /usr/local/bin/goss - goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" - goss_test_directory: /tmp - goss_format: documentation - molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" - molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" - - tasks: - - name: Set JDK Vendor - set_fact: - java_jdk_vendor: adoptopenjdk - - - name: Gather OS specific variables - include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" - - - name: Gather architecture specific variables - include_vars: "../../vars/architecture.yml" - - # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) - # Allowing to 'override' variables that are defined using include_vars - - name: Setting OS specific variables - set_fact: - java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" - java_open_jdk_version_major: "{{ java_open_jdk_version_major if java_open_jdk_version_major is defined and java_open_jdk_version_major is not sameas None and java_open_jdk_version_major else __java_open_jdk_version_major }}" # noqa 204 - - - name: Setting OS specific variables (II) - set_fact: - java_open_jdk_home_dir: "{{ java_open_jdk_home_dir if java_open_jdk_home_dir is defined and java_open_jdk_home_dir is not sameas None and java_open_jdk_home_dir else __java_open_jdk_home_dir }}" # noqa 204 - java_open_jdk_package: "{{ java_open_jdk_package if java_open_jdk_package is defined and java_open_jdk_package is not sameas None and java_open_jdk_package else __java_open_jdk_package }}" # noqa 204 - - - name: Setting specific variables - set_fact: - java_home: "{{ java_open_jdk_home }}" - - - name: Download and install goss - get_url: - url: "{{ goss_url }}" - dest: "{{ goss_dst }}" - mode: 0755 - - - name: Copy tests to remote - template: - src: "{{ item }}" - dest: "{{ goss_test_directory }}/{{ item | basename }}" - with_fileglob: - - "{{ playbook_dir }}/tests/test_*.yml" - - - name: Register test files - shell: "ls {{ goss_test_directory }}/test_*.yml" - register: test_files - changed_when: false - - - name: Execute Goss tests - command: "goss -g {{ item }} validate --format {{ goss_format }}" - register: test_results - with_items: "{{ test_files.stdout_lines }}" - ignore_errors: true - changed_when: false - - - name: Display details about the goss results - debug: - msg: "{{ item.stdout_lines }}" - with_items: "{{ test_results.results }}" - - - name: Fail when tests fail - fail: - msg: "Goss failed to validate" - when: item.rc != 0 - with_items: "{{ test_results.results }}" diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 index 8e3be40..25c6350 100644 --- a/molecule/default/Dockerfile.j2 +++ b/molecule/default/Dockerfile.j2 @@ -9,6 +9,18 @@ FROM {{ item.image }} RUN mkdir -p /usr/share/man/man1 RUN if [ $(command -v apt-get) ]; then sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' /etc/apt/apt.conf.d/docker-clean; fi +{% if 'stretch' in item.image %} +RUN echo "deb http://archive.debian.org/debian/ stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch contrib main non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \ + apt-get update +{% endif %} + RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash ca-certificates && apt-get clean; \ elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ diff --git a/molecule/temurin/Dockerfile.j2 b/molecule/temurin/Dockerfile.j2 index 5dbc587..ce3b9d8 100644 --- a/molecule/temurin/Dockerfile.j2 +++ b/molecule/temurin/Dockerfile.j2 @@ -8,6 +8,18 @@ FROM {{ item.image }} RUN mkdir -p /usr/share/man/man1 +{% if 'stretch' in item.image %} +RUN echo "deb http://archive.debian.org/debian/ stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch contrib main non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \ + apt-get update +{% endif %} + RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash ca-certificates && apt-get clean; \ elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ diff --git a/vars/openjdk/Debian-9.yml b/vars/openjdk/Debian-9.yml new file mode 100644 index 0000000..f5f7188 --- /dev/null +++ b/vars/openjdk/Debian-9.yml @@ -0,0 +1,13 @@ +--- + +# Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) +__java_open_jdk_version_major: 11 +__java_keystore_dir: lib/security +# Supported openjdk major releases: 11 + +__java_required_repositories_openjdk: "deb http://archive.debian.org/debian stretch-backports main" +__java_required_libs_openjdk: [] +__java_required_key_repositories_openjdk: [] + +__java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless +__java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} diff --git a/vars/temurin/Debian-9.yml b/vars/temurin/Debian-9.yml new file mode 100644 index 0000000..b0179b9 --- /dev/null +++ b/vars/temurin/Debian-9.yml @@ -0,0 +1,17 @@ +--- +java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https +__java_open_jdk_version_major: 8 +__java_keystore_dir: jre/lib/security +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +__java_required_libs_openjdk: [] + +__java_required_key_repositories_openjdk: + - https://packages.adoptium.net/artifactory/api/gpg/key/public +__java_required_repositories_openjdk: + - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main +__java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} +__java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk From 28d49770040b86715432350260ed121cda1d2243 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Mon, 14 Aug 2023 13:02:00 +0200 Subject: [PATCH 11/14] #210 - Migrate to Adoptium temurin. Fixed str to int error --- tasks/install_openjdk.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 865b685..3b85986 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -119,11 +119,15 @@ alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" - when: "ansible_os_family == 'Debian' and java_open_jdk_version_major < '11'" + when: + - ansible_os_family == 'Debian' + - java_open_jdk_version_major | int < 11 - name: "Correct java version selected /usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java in java >= 11" alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" - when: "ansible_os_family == 'Debian' and java_open_jdk_version_major >= '11'" + when: + - ansible_os_family == 'Debian' + - java_open_jdk_version_major | int >= 11 From df1aab73080b2f62309a033c1f86ff4a41196ef7 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Mon, 14 Aug 2023 14:30:01 +0200 Subject: [PATCH 12/14] #210 - Migrate to Adoptium temurin. Remove old deprecated repositories --- .yamllint | 1 - tasks/install_openjdk.yml | 15 ++++++++++----- vars/temurin/Debian-10.yml | 2 ++ vars/temurin/Debian-11.yml | 2 ++ vars/temurin/Debian-12.yml | 2 ++ vars/temurin/Debian-9.yml | 2 ++ vars/temurin/Ubuntu-20.yml | 2 ++ vars/temurin/Ubuntu-22.yml | 2 ++ 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.yamllint b/.yamllint index 2d346b3..bb151ec 100644 --- a/.yamllint +++ b/.yamllint @@ -12,7 +12,6 @@ rules: # NOTE(retr0h): Templates no longer fail this lint rule. # Uncomment if running old Molecule templates. # truthy: disable - ignore: | tests/ .travis.yml diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 3b85986..51815e4 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -5,7 +5,6 @@ java_jdk_vendor: "temurin" when: "java_jdk_vendor == 'adoptopenjdk'" - - name: Java | Gather OS specific variables include_vars: "{{ item }}" with_first_found: @@ -24,6 +23,7 @@ java_required_repositories_openjdk: "{{ java_required_repositories_openjdk if java_required_repositories_openjdk is defined and java_required_repositories_openjdk is not sameas None and java_required_repositories_openjdk | length else __java_required_repositories_openjdk }}" java_required_key_repositories_openjdk: "{{ java_required_key_repositories_openjdk if java_required_key_repositories_openjdk is defined and java_required_key_repositories_openjdk is not sameas None and java_required_key_repositories_openjdk | length else __java_required_key_repositories_openjdk }}" java_required_libs_openjdk: "{{ java_required_libs_openjdk if java_required_libs_openjdk is defined and java_required_libs_openjdk is not sameas None and java_required_libs_openjdk | length else __java_required_libs_openjdk }}" + java_deprecated_repositories_adoptopenjdk: "{{ java_deprecated_repositories_adoptopenjdk if java_deprecated_repositories_adoptopenjdk is defined and java_deprecated_repositories_adoptopenjdk is not sameas None and java_deprecated_repositories_adoptopenjdk | length else __java_deprecated_repositories_adoptopenjdk }}" - name: Java | Setting OS and architecture specific variables (II) set_fact: @@ -36,6 +36,11 @@ - name: Java | Debian pre-requisites block: + - name: Java | Remove deprecated repositories + apt_repository: + repo: "{{ item }}" + state: absent + with_items: "{{ java_deprecated_repositories_adoptopenjdk }}" - name: Java | Install extra apt tools package: name: "{{ java_open_jdk_apt_extra_packages }}" @@ -119,8 +124,8 @@ alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/jre/bin/java" - when: - - ansible_os_family == 'Debian' + when: + - ansible_os_family == 'Debian' - java_open_jdk_version_major | int < 11 @@ -128,6 +133,6 @@ alternatives: name: java path: "/usr/lib/jvm/{{ java_open_jdk_home_dir }}/bin/java" - when: - - ansible_os_family == 'Debian' + when: + - ansible_os_family == 'Debian' - java_open_jdk_version_major | int >= 11 diff --git a/vars/temurin/Debian-10.yml b/vars/temurin/Debian-10.yml index b0179b9..878a361 100644 --- a/vars/temurin/Debian-10.yml +++ b/vars/temurin/Debian-10.yml @@ -15,3 +15,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/temurin/Debian-11.yml b/vars/temurin/Debian-11.yml index 0d3791b..a1ee22a 100644 --- a/vars/temurin/Debian-11.yml +++ b/vars/temurin/Debian-11.yml @@ -15,3 +15,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/temurin/Debian-12.yml b/vars/temurin/Debian-12.yml index 0d3791b..a1ee22a 100644 --- a/vars/temurin/Debian-12.yml +++ b/vars/temurin/Debian-12.yml @@ -15,3 +15,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/temurin/Debian-9.yml b/vars/temurin/Debian-9.yml index b0179b9..878a361 100644 --- a/vars/temurin/Debian-9.yml +++ b/vars/temurin/Debian-9.yml @@ -15,3 +15,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/temurin/Ubuntu-20.yml b/vars/temurin/Ubuntu-20.yml index 41aa7ed..fad294b 100644 --- a/vars/temurin/Ubuntu-20.yml +++ b/vars/temurin/Ubuntu-20.yml @@ -14,3 +14,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/temurin/Ubuntu-22.yml b/vars/temurin/Ubuntu-22.yml index 41aa7ed..fad294b 100644 --- a/vars/temurin/Ubuntu-22.yml +++ b/vars/temurin/Ubuntu-22.yml @@ -14,3 +14,5 @@ __java_required_repositories_openjdk: - deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main __java_open_jdk_home_dir: temurin-{{ java_open_jdk_version_major }}-jdk-{{ java_open_jdk_home_dir_suffix }} __java_open_jdk_package: temurin-{{ java_open_jdk_version_major }}-jdk +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main From 241a7f0096a4d37735d63b801ee6aab87aa0bb4c Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Mon, 14 Aug 2023 14:46:07 +0200 Subject: [PATCH 13/14] #210 - Migrate to Adoptium temurin. Remove old deprecated repositories --- tasks/install_openjdk.yml | 1 + vars/corretto/CentOS-8.yml | 1 + vars/corretto/Debian-10.yml | 1 + vars/corretto/Debian-11.yml | 1 + vars/corretto/Debian-12.yml | 1 + vars/openjdk/CentOS-7.yml | 1 + vars/openjdk/CentOS-8.yml | 1 + vars/openjdk/Debian-10.yml | 2 ++ vars/openjdk/Debian-11.yml | 2 ++ vars/openjdk/Debian-12.yml | 2 ++ vars/openjdk/Debian-9.yml | 2 ++ vars/openjdk/Ubuntu-18.yml | 1 + vars/openjdk/Ubuntu-20.yml | 1 + vars/openjdk/Ubuntu-22.yml | 1 + 14 files changed, 18 insertions(+) diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 51815e4..78eb8a8 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -41,6 +41,7 @@ repo: "{{ item }}" state: absent with_items: "{{ java_deprecated_repositories_adoptopenjdk }}" + when: java_deprecated_repositories_adoptopenjdk | length > 0 - name: Java | Install extra apt tools package: name: "{{ java_open_jdk_apt_extra_packages }}" diff --git a/vars/corretto/CentOS-8.yml b/vars/corretto/CentOS-8.yml index f56374f..6d1e44e 100644 --- a/vars/corretto/CentOS-8.yml +++ b/vars/corretto/CentOS-8.yml @@ -12,3 +12,4 @@ __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto- __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto __java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/corretto/Debian-10.yml b/vars/corretto/Debian-10.yml index b475bb4..a488bb6 100644 --- a/vars/corretto/Debian-10.yml +++ b/vars/corretto/Debian-10.yml @@ -15,3 +15,4 @@ __java_required_libs_openjdk: [] __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/corretto/Debian-11.yml b/vars/corretto/Debian-11.yml index 737ceca..9c5bf9b 100644 --- a/vars/corretto/Debian-11.yml +++ b/vars/corretto/Debian-11.yml @@ -16,3 +16,4 @@ __java_required_libs_openjdk: [] __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/corretto/Debian-12.yml b/vars/corretto/Debian-12.yml index 737ceca..9c5bf9b 100644 --- a/vars/corretto/Debian-12.yml +++ b/vars/corretto/Debian-12.yml @@ -16,3 +16,4 @@ __java_required_libs_openjdk: [] __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/openjdk/CentOS-7.yml b/vars/openjdk/CentOS-7.yml index bc5ed94..947caa8 100644 --- a/vars/openjdk/CentOS-7.yml +++ b/vars/openjdk/CentOS-7.yml @@ -11,3 +11,4 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: "java-{{ java_open_jdk_version_major }}-openjdk-headless" __java_open_jdk_home_dir: "jre-{{ java_open_jdk_version_major }}" +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/openjdk/CentOS-8.yml b/vars/openjdk/CentOS-8.yml index 814f539..1660379 100644 --- a/vars/openjdk/CentOS-8.yml +++ b/vars/openjdk/CentOS-8.yml @@ -11,3 +11,4 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: "java-{{ java_open_jdk_version_major }}-openjdk-headless" __java_open_jdk_home_dir: "jre-{{ java_open_jdk_version_major }}" +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/openjdk/Debian-10.yml b/vars/openjdk/Debian-10.yml index 655753d..d08d0e1 100644 --- a/vars/openjdk/Debian-10.yml +++ b/vars/openjdk/Debian-10.yml @@ -11,3 +11,5 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/openjdk/Debian-11.yml b/vars/openjdk/Debian-11.yml index 01c74d9..9c71317 100644 --- a/vars/openjdk/Debian-11.yml +++ b/vars/openjdk/Debian-11.yml @@ -14,3 +14,5 @@ __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} ansible_python_interpreter: /usr/bin/python3 +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/openjdk/Debian-12.yml b/vars/openjdk/Debian-12.yml index 417e216..d4a9fe9 100644 --- a/vars/openjdk/Debian-12.yml +++ b/vars/openjdk/Debian-12.yml @@ -14,3 +14,5 @@ __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} ansible_python_interpreter: /usr/bin/python3 +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/openjdk/Debian-9.yml b/vars/openjdk/Debian-9.yml index f5f7188..2cafcec 100644 --- a/vars/openjdk/Debian-9.yml +++ b/vars/openjdk/Debian-9.yml @@ -11,3 +11,5 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} +__java_deprecated_repositories_adoptopenjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main diff --git a/vars/openjdk/Ubuntu-18.yml b/vars/openjdk/Ubuntu-18.yml index 3e5a29a..4245937 100644 --- a/vars/openjdk/Ubuntu-18.yml +++ b/vars/openjdk/Ubuntu-18.yml @@ -15,3 +15,4 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/openjdk/Ubuntu-20.yml b/vars/openjdk/Ubuntu-20.yml index 9fbba5a..86e30dd 100644 --- a/vars/openjdk/Ubuntu-20.yml +++ b/vars/openjdk/Ubuntu-20.yml @@ -14,3 +14,4 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} +__java_deprecated_repositories_adoptopenjdk: [] diff --git a/vars/openjdk/Ubuntu-22.yml b/vars/openjdk/Ubuntu-22.yml index d9a187e..9709921 100644 --- a/vars/openjdk/Ubuntu-22.yml +++ b/vars/openjdk/Ubuntu-22.yml @@ -14,3 +14,4 @@ __java_required_key_repositories_openjdk: [] __java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-{{ java_open_jdk_home_dir_suffix }} +__java_deprecated_repositories_adoptopenjdk: [] From fb1a6175e1f2e3b63e101dd294ca76feaf951c29 Mon Sep 17 00:00:00 2001 From: Santiago Orobon Date: Wed, 16 Aug 2023 13:53:51 +0200 Subject: [PATCH 14/14] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3e23f..ab33e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) + +## [9.0.0](https://github.com/idealista/java_role/tree/9.0.0) (2023-08-16) ### Added - *[#210](https://github.com/idealista/java_role/issues/210) Temurin support* @sorobon - *[#210](https://github.com/idealista/java_role/issues/210) Debian 12 support* @sorobon +- *[#210](https://github.com/idealista/java_role/issues/210) Remove deprecated repositories* @sorobon ### Removed - *[#210](https://github.com/idealista/java_role/issues/210) Removed adoptopenjdk* @sorobon