Any way to dynamically set `region` and `datacenter` in nomad?

the ability to use go-discover in retry_join definitely helps with setup, but I’m just thinking that if there could be some way to automatically set region and datacenter, that would be great.

Admittedly, one size (or piece of logic) does not fit all, but I can’t help wondering if we could at least achieve something basic (say we take the value of datacenter from the value of the AWS AZ that we discover). Is anybody working on anything like this?

How do folks fill in these values? do you have some other config management thing that fills in the values before starting up nomad?

Hi @jeffreyjflim,

Admittedly, one size (or piece of logic) does not fit all, but I can’t help wondering if we could at least achieve something basic (say we take the value of datacenter from the value of the AWS AZ that we discover). Is anybody working on anything like this?

This is something that is not being worked on nor considered because we have not had a request like this before; that I am aware of. I can think of several interesting challenges with trying to implement such a feature, particularly relating to how early a Nomad agent requires this information during its startup sequence. It would also need to support template syntax to accommodate multiple cloud providers and each operators personal requirements.

How do folks fill in these values? do you have some other config management thing that fills in the values before starting up nomad?

Yes, it is expected that this information is populated by templating provided outside of Nomad by tools providing configuration management (Ansible, Chef, Puppet) or instance bootstrapping (userdata, cloud-init).

Please let me know if you have any followup questions or comments.

Thanks,
jrasell and the Nomad team