From e6bd07faf78fb0895504817b398008a339e0d368 Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Thu, 12 Jan 2023 12:18:28 +0100 Subject: [PATCH] Use assert to test/validate condition This test seems to have a fault, where the variable/list kolla_ironic_enabled_console_interfaces could be undefined, the test would not fail. Anyway, using assert shows what we're testing, and doesn't list the task as skipped when we meet the requirements. Change-Id: Id9c4abc285be0240f9bdc21d21537d3a2d9bfd57 --- ansible/kolla-ansible.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml index a469e474d..cca4afa74 100644 --- a/ansible/kolla-ansible.yml +++ b/ansible/kolla-ansible.yml @@ -12,14 +12,14 @@ tasks: - name: Validate serial console configuration block: - - name: Check ipmitool-socat is in enabled in kolla_ironic_enabled_console_interfaces - fail: - msg: > + - name: Check ipmitool-socat is in kolla_ironic_enabled_console_interfaces + assert: + that: + - kolla_ironic_enabled_console_interfaces is defined + - "'ipmitool-socat' in kolla_ironic_enabled_console_interfaces" + fail_msg: > kolla_ironic_enabled_console_interfaces must contain ipmitool-socat if you set ironic_serial_console_autoenable to true - when: - - kolla_ironic_enabled_console_interfaces is defined - - "'ipmitool-socat' not in kolla_ironic_enabled_console_interfaces" when: ironic_serial_console_autoenable | bool - name: Ensure Kolla Ansible is configured