Skip to content

Commit 5dea799

Browse files
authored
Merge pull request #3910 from csawyerYumaed/patch-2
Template docs, add vault PKI integration example.
2 parents 06f0b00 + 4a19728 commit 5dea799

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

website/source/docs/job-specification/template.html.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,24 @@ The parser will read the JSON string, so the `$CERT_PEM` environment variable
221221
will be identical to the contents of the file.
222222

223223
For more details see [go-envparser's
224-
README](https://github.com/schmichael/go-envparse#readme).
224+
README](https://github.com/hashicorp/go-envparse#readme).
225+
226+
## Vault Integration
227+
228+
This example acquires a PKI certificate from Vault in PEM format and stores it into your application's secret directory.
229+
230+
```hcl
231+
template {
232+
data = <<EOH
233+
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" "format=pem" }}
234+
{{ .Data.certificate }}
235+
{{ .Data.issuing_ca }}
236+
{{ .Data.private_key }}{{ end }}
237+
EOH
238+
destination = "${NOMAD_SECRETS_DIR}/bundle.pem"
239+
change_mode = "restart"
240+
}
241+
```
225242

226243
## Client Configuration
227244

0 commit comments

Comments
 (0)