From 1e2ac5eb2829dac3f637c7f6c2e00b1c980b22c3 Mon Sep 17 00:00:00 2001
From: Michal Nasiadka <mnasiadka@gmail.com>
Date: Thu, 23 Nov 2023 10:54:46 +0000
Subject: [PATCH] kolla-bifrost: Add precheck for inspection allocation pool

Change-Id: I73fad29af6a57b29afea46947d1ae90546253a2a
---
 ansible/roles/kolla-bifrost/tasks/main.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ansible/roles/kolla-bifrost/tasks/main.yml b/ansible/roles/kolla-bifrost/tasks/main.yml
index ab8f1417..ad5b6b40 100644
--- a/ansible/roles/kolla-bifrost/tasks/main.yml
+++ b/ansible/roles/kolla-bifrost/tasks/main.yml
@@ -1,4 +1,12 @@
 ---
+- name: Check if inspection allocation is defined
+  assert:
+    that:
+      - kolla_bifrost_dhcp_pool_start | length > 0
+      - kolla_bifrost_dhcp_pool_end | length > 0
+      - kolla_bifrost_dhcp_pool_mask | length > 0
+    fail_msg: "Inspection allocation pool for provisioning network is not properly defined"
+
 - name: Ensure the Kolla Bifrost configuration directories exist
   file:
     path: "{{ kolla_node_custom_config_path }}/bifrost"
-- 
GitLab