From 8d29f0718c0477732bfda4394cd473643978c3f3 Mon Sep 17 00:00:00 2001
From: Erik Berg <openstack@slipsprogrammor.no>
Date: Mon, 9 Jan 2023 17:20:04 +0100
Subject: [PATCH] zun: 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-Id: Iffb84aa14b930eb82cf2043add721c1717ca6c74
---
 ansible/roles/zun/tasks/precheck.yml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ansible/roles/zun/tasks/precheck.yml b/ansible/roles/zun/tasks/precheck.yml
index e8322b1e2f..e7fa94dc69 100644
--- a/ansible/roles/zun/tasks/precheck.yml
+++ b/ansible/roles/zun/tasks/precheck.yml
@@ -49,10 +49,9 @@
     - inventory_hostname in groups['zun-cni-daemon']
 
 - name: Ensure kuryr enabled for zun
-  fail:
-    msg: "kuryr is required but not enabled"
+  assert:
+    that: enable_kuryr | bool
+    fail_msg: "kuryr is required but not enabled"
   run_once: True
-  changed_when: false
   when:
     - enable_zun | bool
-    - not enable_kuryr | bool