From 50bdb615756dc6dcd6cb3ab9ab5d08658c0bbc70 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 7 Sep 2022 11:11:10 -0700 Subject: [PATCH] Wait until Nomad is running before bootstrapping ACLs --- nomad/setup-cluster.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nomad/setup-cluster.yml b/nomad/setup-cluster.yml index 4b9a6b4..53d3d4d 100644 --- a/nomad/setup-cluster.yml +++ b/nomad/setup-cluster.yml @@ -404,7 +404,18 @@ hosts: nomad_instances tasks: - # Need to wait until nomad is running + - name: Nomad API reachable? + uri: + url: "http://127.0.0.1:4646/v1/status/leader" + method: GET + status_code: 200 + register: nomad_check_result + retries: 6 + until: nomad_check_result is succeeded + delay: 10 + changed_when: false + run_once: true + - name: Bootstrap ACLs command: argv: