From d376240efffc1143908d88cfb682f7092291252f Mon Sep 17 00:00:00 2001 From: martinfanning1 <41327835+martinfanning1@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:46:31 +0000 Subject: [PATCH] OHS Base Install - Improve checks on Patch OHS when there are no patches (#104) * Update main.yml - change AND condition to OR Update main.yml - change AND condition to OR Failed when deploying VM in Jenkins.. despite all molecule tests passing. * Update main.yml Add When to Check if Patch applied * Update main.yml Improve checks on Patch OHS when there are no patches --- roles/ohs/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/ohs/tasks/main.yml b/roles/ohs/tasks/main.yml index 542bea5..a2b4a8b 100644 --- a/roles/ohs/tasks/main.yml +++ b/roles/ohs/tasks/main.yml @@ -33,6 +33,7 @@ changed_when: False ignore_errors: True loop: "{{ patches }}" + when: ohs_version is defined - name: Print ohs_version_status debug: @@ -41,7 +42,10 @@ - name: Patch OHS include_tasks: "patch.yml" - when: ohs_version is defined and ohs_version_status.results | selectattr('rc','greaterthan',0) | list | count > 0 + when: + - patches | length > 0 + - ohs_version is defined + - ohs_version_status.results | selectattr('rc', 'greaterthan', 0) | list | count > 0 - name: Set up properties file include_tasks: "config.yml"