How to wait for Nomad to be ready in order to bootstrap ACLs

Hi, I have an ansible script to deploy and configure a Nomas server with ACL enabled.

In order to bootstrap, I need first to wait for the Nomad server to be ready and this is not a straightforward process. The nodes need to build a quorum and check a few things which takes time, and I can’t run nomad status to monitor Nomad agents because otherwise I will get an unauthorized error message.

I would like to ask how should I monitor Nomad service to identify when it is ready so I can run the nomad acl bootstrap command?

thank you

Hi @masuberu,

I would suggest using the /v1/status/leader endpoint to check that a quorum has been formed and a leader elected. This API call does not require and ACL, so should be well suited to this use case.

Thanks,
jrasell and the Nomad team