From 2a15d11df778ec12e8593ad233d79b47bdc31549 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Tue, 20 Aug 2024 10:04:04 +1000 Subject: [PATCH] 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: