Merge pull request #2234 from hashicorp/f-doc-template-env-var

Mention nomad's runtime environment being available now
This commit is contained in:
Michael Schurter 2017-01-23 17:28:02 -08:00 committed by GitHub
commit 5a25d49a9b
1 changed files with 8 additions and 3 deletions

View File

@ -39,8 +39,10 @@ job "docs" {
}
```
Nomad utilizes a tool called [Consul Template][ct]. For a full list of the
API template functions, please refer to the [Consul Template README][ct].
Nomad utilizes a tool called [Consul Template][ct]. Since Nomad v0.5.3, the
template can reference [Nomad's runtime environment variables][env]. For a full
list of the API template functions, please refer to the [Consul Template
README][ct].
## `template` Parameters
@ -97,7 +99,9 @@ It is also possible to use heredocs for multi-line templates, like:
template {
data = <<EOH
---
key: {{ key "service/my-key" }}
bind_port: {{ env "NOMAD_PORT_db" }}
scratch_dir: {{ env "NOMAD_TASK_DIR" }}
service_key: {{ key "service/my-key" }}
EOH
destination = "local/file.yml"
@ -131,3 +135,4 @@ options](/docs/agent/config.html#options):
[ct]: https://github.com/hashicorp/consul-template "Consul Template by HashiCorp"
[artifact]: /docs/job-specification/artifact.html "Nomad artifact Job Specification"
[env]: /docs/runtime/environment.html "Nomad Runtime Environment"