Template docs, add vault PKI integration example.

Update the template documentation, and add a vault PKI integration example.
This commit is contained in:
csawyerYumaed 2018-02-26 12:41:39 -08:00 committed by GitHub
parent 2228e1fd0c
commit 88ed5ad112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -223,6 +223,24 @@ will be identical to the contents of the file.
For more details see [go-envparser's For more details see [go-envparser's
README](https://github.com/schmichael/go-envparse#readme). README](https://github.com/schmichael/go-envparse#readme).
## Vault Integration
This example will grab a PKI certificate from Vault and put it out on local disk for your application in PEM format
including the CA, public and private key in 1 file.
```
template {
data = <<EOH
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" "format=pem" }}
{{ .Data.certificate }}
{{ .Data.issuing_ca }}
{{ .Data.private_key }}{{ end }}
EOH
destination = "$${NOMAD_SECRETS_DIR}/bundle.pem"
change_mode = "restart"
}
```
## Client Configuration ## Client Configuration
The `template` block has the following [client configuration The `template` block has the following [client configuration