From 3289bb28b0a697ea5fc8e05da9b1ef35ba54ca80 Mon Sep 17 00:00:00 2001 From: Gregory Mulvaney Date: Fri, 8 Dec 2023 09:40:50 -0600 Subject: [PATCH] Fixed required variable validation (#1074) --- bootstrap/tasks/validation/vars.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap/tasks/validation/vars.yaml b/bootstrap/tasks/validation/vars.yaml index 9e81b7ee..2800b470 100644 --- a/bootstrap/tasks/validation/vars.yaml +++ b/bootstrap/tasks/validation/vars.yaml @@ -1,8 +1,9 @@ --- - - name: Verify required bootstrap vars are set ansible.builtin.assert: - that: item | default('', true) | trim != '' + that: + - vars[item] is defined + - vars[item] | default('', true) | trim != '' success_msg: Required bootstrap var {{ item }} exists and is defined fail_msg: Required bootstrap var {{ item }} does not exists or is not defined loop: @@ -34,4 +35,4 @@ fail_msg: Node name {{ item.name }} is not valid loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}" loop_control: - label: "{{ item.name }}" + label: "{{ item.name }}"