Can I define envs in both env and template block of nomad job spec

Hey everyone,
is it allowed to specify env both in env block and template block of job spec or the latter always overwrites the 1st one? (assuming that both contains different env variables)

It seems to me that the 1st block is skipped when you specify both but just wanted to clarify :slight_smile:

Hi @pawelbeza,

Specifying environments variables by either method should work and not conflict with each other, unless the same variable is define. In this case, I believe the template block definition would take precedence.

If you have a job specification that show something not working as expected, please share it and I can take a look.

Thanks,
jrasell and the Nomad team

1 Like