From 9e0bf394bb57e7fb5e67282e9958893e818fbc0d Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 4 Oct 2024 10:31:20 +0530 Subject: [PATCH] Add DNS resolution check with retries for daemon URL --- service-provider-setup/run-laconic-console.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/service-provider-setup/run-laconic-console.yml b/service-provider-setup/run-laconic-console.yml index 43655e7..1374ca5 100644 --- a/service-provider-setup/run-laconic-console.yml +++ b/service-provider-setup/run-laconic-console.yml @@ -48,6 +48,19 @@ set_fact: ALICE_PK: "{{ alice_pk.stdout }}" + - name: Check if DNS resolves for daemon + command: getent ahosts {{ org_id }}-daemon.{{ full_domain }} + register: dns_check + retries: 5 + delay: 5 + until: dns_check.rc == 0 + ignore_errors: yes + + - name: Fail if DNS does not resolve after retries + fail: + msg: "DNS resolution failed for example.com after 5 retries" + when: dns_check.rc != 0 + - name: Start the laconic console deployment command: laconic-so deployment --dir laconic-console-deployment start