From f493b0f2e3a053fbd3bedce186fe05ad4f89b26a Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Thu, 29 Aug 2024 09:05:52 +1000 Subject: [PATCH 1/4] ITPLT-4019 Backwards compatible change to allow testing of Corretto JDK on AZL2023 --- roles/product_common/defaults/main.yml | 1 + roles/product_common/tasks/amazon-2023.yml | 26 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/roles/product_common/defaults/main.yml b/roles/product_common/defaults/main.yml index 2326b18..9c6d676 100644 --- a/roles/product_common/defaults/main.yml +++ b/roles/product_common/defaults/main.yml @@ -5,6 +5,7 @@ postgres_version: "9.6" # Disable these when using the product installer, otherwise we end up # fighting with it. atl_use_system_jdk: false +atl_use_system_jdk_flavor: "temurin" # amazon linux 2023 also supports "corretto" # Ubuntu and Ansible use different architecture nomenclature; provide # an easy method for translating between them diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index c10bd85..d34793f 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -1,5 +1,5 @@ --- - +# Temurin JDK installation - name: Add Adoptium repo and install Eclipse Temurin JDK if necessary on Amazon Linux 2023 block: @@ -124,10 +124,32 @@ path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk" priority: 99 - when: atl_use_system_jdk | bool + when: + - atl_use_system_jdk | bool + - atl_use_system_jdk_flavor == "temurin" tags: - runtime_pkg +# Corretto JDK installation +- name: Install Corretto JDK if necessary on Amazon Linux 2023 + block: + - name: Install Corretto JDK Headless + ansible.builtin.dnf: + name: "java-{{ java_major_version }}-amazon-corretto-headless" + state: present + tags: + - runtime_pkg + + - name: Ensure common JDK symlink exists + community.general.alternatives: + link: "/usr/lib/jvm/java" + name: "java_sdk" + path: "/usr/lib/jvm/java-{{ java_major_version }}-amazon-corretto" + priority: 99 + when: + - atl_use_system_jdk | bool + - atl_use_system_jdk_flavor == "corretto" + - name: Install other base packages on Amazon Linux 2023 ansible.builtin.dnf: name: From 90a394c302269bd7e97e106c4db9902c46fea279 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Thu, 29 Aug 2024 09:10:25 +1000 Subject: [PATCH 2/4] ITPLT-4019 move tags to block --- roles/product_common/tasks/amazon-2023.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index d34793f..1b7a1e2 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -137,8 +137,6 @@ ansible.builtin.dnf: name: "java-{{ java_major_version }}-amazon-corretto-headless" state: present - tags: - - runtime_pkg - name: Ensure common JDK symlink exists community.general.alternatives: @@ -149,6 +147,8 @@ when: - atl_use_system_jdk | bool - atl_use_system_jdk_flavor == "corretto" + tags: + - runtime_pkg - name: Install other base packages on Amazon Linux 2023 ansible.builtin.dnf: From e9684abc5224f525c74dd989079064488dba4fd2 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Mon, 2 Sep 2024 08:37:04 +1000 Subject: [PATCH 3/4] ITPLT-4019 renaming var --- roles/product_common/defaults/main.yml | 2 +- roles/product_common/tasks/amazon-2023.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/product_common/defaults/main.yml b/roles/product_common/defaults/main.yml index 9c6d676..bbbc219 100644 --- a/roles/product_common/defaults/main.yml +++ b/roles/product_common/defaults/main.yml @@ -5,7 +5,7 @@ postgres_version: "9.6" # Disable these when using the product installer, otherwise we end up # fighting with it. atl_use_system_jdk: false -atl_use_system_jdk_flavor: "temurin" # amazon linux 2023 also supports "corretto" +atl_system_jdk_vendor: "temurin" # amazon linux 2023 also supports "corretto" # Ubuntu and Ansible use different architecture nomenclature; provide # an easy method for translating between them diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 1b7a1e2..13a10f7 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -126,7 +126,7 @@ when: - atl_use_system_jdk | bool - - atl_use_system_jdk_flavor == "temurin" + - atl_system_jdk_vendor == "temurin" tags: - runtime_pkg @@ -146,7 +146,7 @@ priority: 99 when: - atl_use_system_jdk | bool - - atl_use_system_jdk_flavor == "corretto" + - atl_system_jdk_vendor == "corretto" tags: - runtime_pkg From 5c847638cddbaa8973901aa2cc155be5a483ee18 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Mon, 2 Sep 2024 08:38:33 +1000 Subject: [PATCH 4/4] ITPLT-4019 tidying up comments --- roles/product_common/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_common/defaults/main.yml b/roles/product_common/defaults/main.yml index bbbc219..6c9fae9 100644 --- a/roles/product_common/defaults/main.yml +++ b/roles/product_common/defaults/main.yml @@ -5,7 +5,7 @@ postgres_version: "9.6" # Disable these when using the product installer, otherwise we end up # fighting with it. atl_use_system_jdk: false -atl_system_jdk_vendor: "temurin" # amazon linux 2023 also supports "corretto" +atl_system_jdk_vendor: "temurin" # Ubuntu and Ansible use different architecture nomenclature; provide # an easy method for translating between them