From 7c0d71261733699e35576296c21ec3f4f9a2e60d Mon Sep 17 00:00:00 2001 From: bmeehan Date: Mon, 12 Aug 2024 21:59:54 +1000 Subject: [PATCH 01/16] ITPLT-3960 jdk caching --- roles/product_common/tasks/amazon-2023.yml | 87 +++++++++++++++++++++- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 865f948..8431f6c 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -21,10 +21,91 @@ tags: - molecule-idempotence-notest - - name: Install Eclipse Temurin JDK - ansible.builtin.yum: - name: "temurin-{{ java_major_version }}-jdk" + # test if jdk_download_completed lock direcory exists + - name: Check if jdk_download_completed lock directory exists + ansible.builtin.stat: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" + register: jdk_download_completed_lock + + - name: take out jdk_downloading lock directory + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" + state: directory + register: jdk_downloading_lock + when: + - jdk_download_completed_lock + - not jdk_download_completed_lock.stat.exists + + # handle the jdk download on only 1 node + - block: + + - name: Download Eclipse Temurin JDK with yum + ansible.builtin.yum: + name: "temurin-{{ java_major_version }}-jdk" + state: latest + download_dir: "{{atl_product_home_shared_download_dir}}" + download_only: yes + register: jdk_downloaded + retries: 5 + delay: 30 + until: jdk_downloaded is succeeded + + - name: Create jdk_download_completed lock directory if download was successful + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" + state: directory + when: jdk_downloaded.changed + + - name: Remove jdk_downloading lock directory if we took out succeeded lock + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" + state: absent + when: jdk_downloaded.changed + when: + - jdk_downloading_lock + - jdk_downloading_lock.changed + + # all nodes can wait here in race condition until the completed lock is present + - name: Wait for jdk_download_completed lock to exist + ansible.builtin.wait_for: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" state: present + delay: 30 + failed_when: false + register: jdk_download_completed + retries: 5 + + - name: Find a file called temurin* in atl_product_home_shared_download_dir + ansible.builtin.find: + paths: "{{ atl_product_home_shared_download_dir }}" + patterns: "temurin-{{ java_major_version }}-*.rpm" + file_type: file + recurse: no + size: 1 + register: temurin_rpm_file + + # as long as we have a valid rpm filepath do the copy/install block + - block: + - name: set fact of the basename of the temurin file + ansible.builtin.set_fact: + temurin_src_path: "{{ item.path }}" + temurin_file_name: "{{ item.path |basename }}" + loop: "{{ temurin_rpm_file.files | flatten }}" + + - name: Copy temurin_rpm_file to /tmp because dnf module removes the cached rpm + ansible.builtin.copy: + src: "{{ temurin_src_path }}" + dest: "/tmp/{{ temurin_file_name }}" + + - name: Install JDK from /tmp copy of the rpm file + ansible.builtin.dnf: + name: "/tmp/{{ temurin_file_name }}" + state: present + register: dnf_installed + when: + - jdk_download_completed.state == "directory" + - temurin_rpm_file.files + - temurin_rpm_file.files | length > 0 - name: Ensure common JDK symlink exists community.general.alternatives: From b6d986b71fd630b5518cf030c0539d38819d12e0 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Tue, 13 Aug 2024 16:21:40 +1000 Subject: [PATCH 02/16] ITPLT-3960 add failsafe dnf install of jdk --- roles/product_common/tasks/amazon-2023.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 8431f6c..736bcf9 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -39,11 +39,11 @@ # handle the jdk download on only 1 node - block: - - name: Download Eclipse Temurin JDK with yum - ansible.builtin.yum: + - name: Download Eclipse Temurin JDK with dnf + ansible.builtin.dnf: name: "temurin-{{ java_major_version }}-jdk" - state: latest - download_dir: "{{atl_product_home_shared_download_dir}}" + state: present + download_dir: atl_product_home_shared_download_dir download_only: yes register: jdk_downloaded retries: 5 @@ -89,7 +89,7 @@ - name: set fact of the basename of the temurin file ansible.builtin.set_fact: temurin_src_path: "{{ item.path }}" - temurin_file_name: "{{ item.path |basename }}" + temurin_file_name: "{{ item.path | basename }}" loop: "{{ temurin_rpm_file.files | flatten }}" - name: Copy temurin_rpm_file to /tmp because dnf module removes the cached rpm @@ -106,6 +106,11 @@ - jdk_download_completed.state == "directory" - temurin_rpm_file.files - temurin_rpm_file.files | length > 0 + always: + - name: Always ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) + ansible.builtin.yum: + name: "temurin-{{ java_major_version }}-jdk" + state: present - name: Ensure common JDK symlink exists community.general.alternatives: From 259058980b84a387f5316931e554e3b5ea2a9461 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Tue, 13 Aug 2024 18:29:34 +1000 Subject: [PATCH 03/16] ITPLT-3960 change the lock check timing and move find in-block --- roles/product_common/tasks/amazon-2023.yml | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 736bcf9..d9b254e 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -66,26 +66,26 @@ - jdk_downloading_lock.changed # all nodes can wait here in race condition until the completed lock is present - - name: Wait for jdk_download_completed lock to exist + - name: try waiting for jdk_download_completed lock to exist ansible.builtin.wait_for: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" state: present - delay: 30 - failed_when: false + timeout: 10 + ignore_errors: true register: jdk_download_completed retries: 5 - - name: Find a file called temurin* in atl_product_home_shared_download_dir - ansible.builtin.find: - paths: "{{ atl_product_home_shared_download_dir }}" - patterns: "temurin-{{ java_major_version }}-*.rpm" - file_type: file - recurse: no - size: 1 - register: temurin_rpm_file - # as long as we have a valid rpm filepath do the copy/install block - block: + - name: Find a file called temurin* in atl_product_home_shared_download_dir + ansible.builtin.find: + paths: "{{ atl_product_home_shared_download_dir }}" + patterns: "temurin-{{ java_major_version }}-*.rpm" + file_type: file + recurse: no + size: 1 + register: temurin_rpm_file + - name: set fact of the basename of the temurin file ansible.builtin.set_fact: temurin_src_path: "{{ item.path }}" @@ -103,14 +103,14 @@ state: present register: dnf_installed when: - - jdk_download_completed.state == "directory" - - temurin_rpm_file.files + - jdk_download_completed.state is defined + - temurin_rpm_file.files is defined - temurin_rpm_file.files | length > 0 - always: - - name: Always ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) - ansible.builtin.yum: - name: "temurin-{{ java_major_version }}-jdk" - state: present + + - name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) + ansible.builtin.yum: + name: "temurin-{{ java_major_version }}-jdk" + state: present - name: Ensure common JDK symlink exists community.general.alternatives: From 8cf5f556fd8359a98c3d3f51225ca167d16836fe Mon Sep 17 00:00:00 2001 From: bmeehan Date: Wed, 14 Aug 2024 15:14:06 +1000 Subject: [PATCH 04/16] ITPLT-3960 added the missing default --- roles/product_common/defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/product_common/defaults/main.yml b/roles/product_common/defaults/main.yml index f8a46fd..2326b18 100644 --- a/roles/product_common/defaults/main.yml +++ b/roles/product_common/defaults/main.yml @@ -13,3 +13,5 @@ debian_architecture_translations: aarch64: arm64 debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}" +# path to store jdk download +atl_product_home_shared_download_dir: "{{ atl_shared_mountpoint }}/downloads" \ No newline at end of file From 126389eb9e3ce18c428385499d506361bdc3b71b Mon Sep 17 00:00:00 2001 From: bmeehan Date: Thu, 15 Aug 2024 20:54:54 +1000 Subject: [PATCH 05/16] ITPLT-3960 changed yum to dnf and fixed iindenting --- roles/product_common/tasks/amazon-2023.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index d9b254e..930ea69 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -27,14 +27,14 @@ path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" register: jdk_download_completed_lock - - name: take out jdk_downloading lock directory + - name: create jdk_downloading lock directory ansible.builtin.file: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" state: directory register: jdk_downloading_lock when: - - jdk_download_completed_lock - - not jdk_download_completed_lock.stat.exists + - jdk_download_completed_lock + - not jdk_download_completed_lock.stat.exists # handle the jdk download on only 1 node - block: @@ -56,11 +56,12 @@ state: directory when: jdk_downloaded.changed - - name: Remove jdk_downloading lock directory if we took out succeeded lock + - name: Remove jdk_downloading lock directory if we took out completed lock ansible.builtin.file: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" state: absent when: jdk_downloaded.changed + when: - jdk_downloading_lock - jdk_downloading_lock.changed @@ -108,7 +109,7 @@ - temurin_rpm_file.files | length > 0 - name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) - ansible.builtin.yum: + ansible.builtin.dnf: name: "temurin-{{ java_major_version }}-jdk" state: present From 1afa4b3833239193cfe7ba5137b1c5251ca31624 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Thu, 15 Aug 2024 21:35:49 +1000 Subject: [PATCH 06/16] ITPLT-3960 remove downloading lock regardless of dl outocme --- roles/product_common/tasks/amazon-2023.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 930ea69..c1133c6 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -56,11 +56,10 @@ state: directory when: jdk_downloaded.changed - - name: Remove jdk_downloading lock directory if we took out completed lock + - name: Remove jdk_downloading lock directory on success or fail ansible.builtin.file: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" state: absent - when: jdk_downloaded.changed when: - jdk_downloading_lock From 2a5ded977383a644088c6184f09aaf7e2e594bc5 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Thu, 15 Aug 2024 21:59:37 +1000 Subject: [PATCH 07/16] ITPLT-3960 replace download_dir var with jinja wrapper --- roles/product_common/tasks/amazon-2023.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index c1133c6..4076c26 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -43,7 +43,7 @@ ansible.builtin.dnf: name: "temurin-{{ java_major_version }}-jdk" state: present - download_dir: atl_product_home_shared_download_dir + download_dir: "{{ atl_product_home_shared_download_dir }}" download_only: yes register: jdk_downloaded retries: 5 From 14adb1f168d41bc0e64f22eb76832231b1d69a64 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 16 Aug 2024 22:42:04 +1000 Subject: [PATCH 08/16] ITPLT-3960 really ugly work-around to prevent dnf removing cache files --- roles/product_common/tasks/amazon-2023.yml | 39 ++++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 4076c26..2bcf674 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -39,15 +39,16 @@ # handle the jdk download on only 1 node - block: - - name: Download Eclipse Temurin JDK with dnf + - name: Try 5 times to download Eclipse Temurin JDK with dnf ansible.builtin.dnf: name: "temurin-{{ java_major_version }}-jdk" state: present download_dir: "{{ atl_product_home_shared_download_dir }}" - download_only: yes + download_only: true + update_cache: true register: jdk_downloaded retries: 5 - delay: 30 + delay: 10 until: jdk_downloaded is succeeded - name: Create jdk_download_completed lock directory if download was successful @@ -61,18 +62,19 @@ path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" state: absent + # this when applies to the whole block - only do this block on the one node that created the downloading lock when: - jdk_downloading_lock - jdk_downloading_lock.changed - # all nodes can wait here in race condition until the completed lock is present - - name: try waiting for jdk_download_completed lock to exist + # all nodes can wait here in race condition briefly for dl to complete and the downloaded_lock to exist + - name: wait and test 5 times for jdk_download_completed lock to exist ansible.builtin.wait_for: path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" state: present timeout: 10 ignore_errors: true - register: jdk_download_completed + register: jdk_download_completed_lock retries: 5 # as long as we have a valid rpm filepath do the copy/install block @@ -86,31 +88,24 @@ size: 1 register: temurin_rpm_file - - name: set fact of the basename of the temurin file + - name: set facts for the path and the basename of the temurin file ansible.builtin.set_fact: temurin_src_path: "{{ item.path }}" temurin_file_name: "{{ item.path | basename }}" loop: "{{ temurin_rpm_file.files | flatten }}" - - name: Copy temurin_rpm_file to /tmp because dnf module removes the cached rpm - ansible.builtin.copy: - src: "{{ temurin_src_path }}" - dest: "/tmp/{{ temurin_file_name }}" - - - name: Install JDK from /tmp copy of the rpm file - ansible.builtin.dnf: - name: "/tmp/{{ temurin_file_name }}" - state: present + - name: Install JDK from cache copy of the rpm file - keepcache + ansible.builtin.command: + cmd: "dnf -y install {{ temurin_file_name }} --setopt=installonly_limit=3 --setopt=keepcache=1" register: dnf_installed + when: - - jdk_download_completed.state is defined - - temurin_rpm_file.files is defined - - temurin_rpm_file.files | length > 0 + - jdk_download_completed_lock.state is defined + - jdk_download_completed_lock.state == "directory" - name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) - ansible.builtin.dnf: - name: "temurin-{{ java_major_version }}-jdk" - state: present + ansible.builtin.command: + cmd: "dnf -y install temurin-{{ java_major_version }}-jdk --setopt=installonly_limit=3 --setopt=keepcache=1" - name: Ensure common JDK symlink exists community.general.alternatives: From c8d55818995a0ffbbf989f7e6cb8a4631de255e4 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Fri, 16 Aug 2024 22:44:02 +1000 Subject: [PATCH 09/16] ITPLT-3960 really ugly work-around to prevent dnf removing cache files --- 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 2bcf674..857336b 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -90,13 +90,13 @@ - name: set facts for the path and the basename of the temurin file ansible.builtin.set_fact: - temurin_src_path: "{{ item.path }}" + temurin_file_path: "{{ item.path }}" temurin_file_name: "{{ item.path | basename }}" loop: "{{ temurin_rpm_file.files | flatten }}" - name: Install JDK from cache copy of the rpm file - keepcache ansible.builtin.command: - cmd: "dnf -y install {{ temurin_file_name }} --setopt=installonly_limit=3 --setopt=keepcache=1" + cmd: "dnf -y install {{ temurin_file_path }} --setopt=installonly_limit=3 --setopt=keepcache=1" register: dnf_installed when: From f2142f4fc14e4d34214c5e837dbb332094fcea4a Mon Sep 17 00:00:00 2001 From: Lee Goolsbee Date: Fri, 16 Aug 2024 16:24:48 -0500 Subject: [PATCH 10/16] ITPLT-3960 fix tests --- roles/product_common/molecule/default/molecule.yml | 4 ++++ roles/product_common/molecule/system_jdk/molecule.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/roles/product_common/molecule/default/molecule.yml b/roles/product_common/molecule/default/molecule.yml index fd78aea..549efae 100644 --- a/roles/product_common/molecule/default/molecule.yml +++ b/roles/product_common/molecule/default/molecule.yml @@ -4,8 +4,12 @@ driver: platforms: - name: amazon_linux2023 image: amazonlinux:2023 + groups: + - aws_node_local - name: ubuntu_lts image: ubuntu:jammy + groups: + - aws_node_local provisioner: name: ansible env: diff --git a/roles/product_common/molecule/system_jdk/molecule.yml b/roles/product_common/molecule/system_jdk/molecule.yml index fd78aea..549efae 100644 --- a/roles/product_common/molecule/system_jdk/molecule.yml +++ b/roles/product_common/molecule/system_jdk/molecule.yml @@ -4,8 +4,12 @@ driver: platforms: - name: amazon_linux2023 image: amazonlinux:2023 + groups: + - aws_node_local - name: ubuntu_lts image: ubuntu:jammy + groups: + - aws_node_local provisioner: name: ansible env: From 6ff74dc1f1be1438407ba34cfbe09df87a93c254 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Sat, 17 Aug 2024 07:54:50 +1000 Subject: [PATCH 11/16] ITPLT-3960 make indent rightish and unwrong --- roles/product_common/tasks/amazon-2023.yml | 43 +++++++++++----------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 857336b..61c7096 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -37,30 +37,31 @@ - not jdk_download_completed_lock.stat.exists # handle the jdk download on only 1 node - - block: + - name: Doenload Eclipse Temurin JDK if necessary on a node whilst locking the downloading action + block: - - name: Try 5 times to download Eclipse Temurin JDK with dnf - ansible.builtin.dnf: - name: "temurin-{{ java_major_version }}-jdk" - state: present - download_dir: "{{ atl_product_home_shared_download_dir }}" - download_only: true - update_cache: true - register: jdk_downloaded - retries: 5 - delay: 10 - until: jdk_downloaded is succeeded + - name: Try 5 times to download Eclipse Temurin JDK with dnf + ansible.builtin.dnf: + name: "temurin-{{ java_major_version }}-jdk" + state: present + download_dir: "{{ atl_product_home_shared_download_dir }}" + download_only: true + update_cache: true + register: jdk_downloaded + retries: 5 + delay: 10 + until: jdk_downloaded is succeeded - - name: Create jdk_download_completed lock directory if download was successful - ansible.builtin.file: - path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" - state: directory - when: jdk_downloaded.changed + - name: Create jdk_download_completed lock directory if download was successful + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_download_completed" + state: directory + when: jdk_downloaded.changed - - name: Remove jdk_downloading lock directory on success or fail - ansible.builtin.file: - path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" - state: absent + - name: Remove jdk_downloading lock directory on success or fail + ansible.builtin.file: + path: "{{ atl_product_home_shared_download_dir }}/temurin-{{ java_major_version }}-jdk_downloading" + state: absent # this when applies to the whole block - only do this block on the one node that created the downloading lock when: From 6b8891acb4141fa00ca49fa44d0247e865d54c9d Mon Sep 17 00:00:00 2001 From: bmeehan Date: Sat, 17 Aug 2024 07:55:14 +1000 Subject: [PATCH 12/16] ITPLT-3960 make indent rightish and unwrong --- roles/product_common/tasks/amazon-2023.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 61c7096..5f01e37 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -37,7 +37,7 @@ - not jdk_download_completed_lock.stat.exists # handle the jdk download on only 1 node - - name: Doenload Eclipse Temurin JDK if necessary on a node whilst locking the downloading action + - name: Download Eclipse Temurin JDK if necessary on a node whilst locking the downloading action block: - name: Try 5 times to download Eclipse Temurin JDK with dnf From 9248c270c911ec6b12499651437172289a5a63d1 Mon Sep 17 00:00:00 2001 From: bmeehan Date: Mon, 19 Aug 2024 08:29:28 +1000 Subject: [PATCH 13/16] ITPLT-3960 add ignore_errors to initial download to bypass edgecase where jdk is already installed --- roles/product_common/tasks/amazon-2023.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index 5f01e37..fc794bc 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -47,6 +47,7 @@ download_dir: "{{ atl_product_home_shared_download_dir }}" download_only: true update_cache: true + ignore_errors: true register: jdk_downloaded retries: 5 delay: 10 From fb0cbaaacfdc01603a542d27600645c62bc92c5e Mon Sep 17 00:00:00 2001 From: bmeehan Date: Mon, 19 Aug 2024 08:40:48 +1000 Subject: [PATCH 14/16] ITPLT-3960 fix test --- roles/product_common/molecule/system_jdk/converge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/product_common/molecule/system_jdk/converge.yml b/roles/product_common/molecule/system_jdk/converge.yml index 8fec31a..c466d9c 100644 --- a/roles/product_common/molecule/system_jdk/converge.yml +++ b/roles/product_common/molecule/system_jdk/converge.yml @@ -6,6 +6,7 @@ atl_product_home: "/opt/atlassian/product" atl_product_installation_base: "/opt/atlassian/product/install" atl_installer_temp: "/opt/atlassian/temp" + atl_shared_mountpoint: "/media/atl" atl_product_home_shared: "/media/atl/jira/shared" atl_product_shared_plugins: "/media/atl/jira/shared/plugins/" atl_use_system_jdk: true From 5ae7e3cd67a1d54b6d46038dd50471d5d550080d Mon Sep 17 00:00:00 2001 From: bmeehan Date: Mon, 19 Aug 2024 15:35:31 +1000 Subject: [PATCH 15/16] ITPLT-3960 fix test --- roles/product_common/tasks/amazon-2023.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index fc794bc..dc994bd 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -95,11 +95,13 @@ temurin_file_path: "{{ item.path }}" temurin_file_name: "{{ item.path | basename }}" loop: "{{ temurin_rpm_file.files | flatten }}" + when: "{{ temurin_rpm_file.files | length > 0 }}" - name: Install JDK from cache copy of the rpm file - keepcache ansible.builtin.command: cmd: "dnf -y install {{ temurin_file_path }} --setopt=installonly_limit=3 --setopt=keepcache=1" register: dnf_installed + when: "{{ temurin_rpm_file.files | length > 0 }}" when: - jdk_download_completed_lock.state is defined From 2a15d11df778ec12e8593ad233d79b47bdc31549 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Tue, 20 Aug 2024 10:04:04 +1000 Subject: [PATCH 16/16] ITPLT-3960 tweaking the conditionals and adding a molecule-idempotence-notest tag to the rescue task --- roles/product_common/tasks/amazon-2023.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/product_common/tasks/amazon-2023.yml b/roles/product_common/tasks/amazon-2023.yml index dc994bd..c10bd85 100644 --- a/roles/product_common/tasks/amazon-2023.yml +++ b/roles/product_common/tasks/amazon-2023.yml @@ -95,13 +95,17 @@ temurin_file_path: "{{ item.path }}" temurin_file_name: "{{ item.path | basename }}" loop: "{{ temurin_rpm_file.files | flatten }}" - when: "{{ temurin_rpm_file.files | length > 0 }}" + when: + - temurin_rpm_file is defined + - temurin_rpm_file.files is defined + - temurin_rpm_file.files | length > 0 - name: Install JDK from cache copy of the rpm file - keepcache ansible.builtin.command: cmd: "dnf -y install {{ temurin_file_path }} --setopt=installonly_limit=3 --setopt=keepcache=1" register: dnf_installed - when: "{{ temurin_rpm_file.files | length > 0 }}" + when: + - temurin_file_path is defined when: - jdk_download_completed_lock.state is defined @@ -110,6 +114,8 @@ - name: Ensure Eclipse Temurin JDK is present (get from internet if cache install fails or is unavailable) ansible.builtin.command: cmd: "dnf -y install temurin-{{ java_major_version }}-jdk --setopt=installonly_limit=3 --setopt=keepcache=1" + tags: + - molecule-idempotence-notest - name: Ensure common JDK symlink exists community.general.alternatives: