We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://developer.hashicorp.com/nomad/docs/job-specification/template#environment-variables
It is not clear how to refer to NOMAD_ALLOC_DIR
NOMAD_ALLOC_DIR
CERT_PEM={{ file "NOMAD_ALLOC_DIR/cert.pem" | toJSON }}
The text was updated successfully, but these errors were encountered:
Hi @EugenKon! You can read a bit more on variable interpolation over at https://developer.hashicorp.com/nomad/docs/runtime/interpolation
An example of how we might use NOMAD_ALLOC_DIR in a template block:
template { data = "<html>hello, world</html>" destination = "${NOMAD_ALLOC_DIR}/index.html" }
Sorry, something went wrong.
@philrenaud Your example works perfect. But that is not I am asking for.
Here Go template system tells that $ is not allowed here, thus I removed it from in the my original post.
template { data = <<EOH CERT_PEM={{ file "${NOMAD_ALLOC_DIR}/cert.pem" | toJSON }} EOH destination = "secrets/file.env" env = true }
No branches or pull requests
Issue
https://developer.hashicorp.com/nomad/docs/job-specification/template#environment-variables
It is not clear how to refer to
NOMAD_ALLOC_DIR
CERT_PEM={{ file "NOMAD_ALLOC_DIR/cert.pem" | toJSON }}
The text was updated successfully, but these errors were encountered: