From 73ba96e23a517a47f2dec512c1660e2a575257eb Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Mon, 9 Jan 2023 19:36:46 +0100 Subject: [PATCH] iscsi: Use assert on checks for readability assert will also fail when we're not meeting the conditions, makes clear what we're actually testing, and isn't listed as a skipped task when the condition is ok. Change I940b1d3eceb98e16fa366c243672f588b1412d70 dropped CentOS 7, so now we're just asserting that it's not RedHat. Change-Id: Iec4e9a6922b67f7c9eb79f580fffbcc8160529e9 --- ansible/roles/iscsi/tasks/precheck.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index 4d0e949c99..ac370e56c2 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -26,9 +26,9 @@ - iscsi_services.iscsid.enabled | bool - name: Check supported platforms for tgtd - fail: - msg: - The SCSI target daemon tgtd is not supported on CentOS/RHEL 8 and later + assert: + that: ansible_facts.os_family != 'RedHat' + fail_msg: > + The SCSI target daemon tgtd is not supported on CentOS/RHEL when: - - ansible_facts.os_family == 'RedHat' - enable_tgtd | bool