Skip to content

Commit

Permalink
Improve example of using private token and noop
Browse files Browse the repository at this point in the history
Show multiple templates using different change modes and
explain what they mean.
  • Loading branch information
grembo committed Jul 21, 2022
1 parent 9556e5b commit ab4b7e8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions website/content/docs/job-specification/vault.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,29 @@ template {
change_mode = "noop"
perms = "600"
}
template {
data = <<-EOH
{{ with secret "pki_int/issue/nomad-task"
"common_name=example.service.consul" "ttl=72h"
"alt_names=localhost" "ip_sans=127.0.0.1"}}
{{ .Data.certificate }}
{{ .Data.private_key }}
{{ end }}
EOH
destination = "${NOMAD_SECRETS_DIR}/client.crt"
change_mode = "restart"
perms = "600"
}
```

The example above uses `change_mode = "noop"` in the `template` stanza for
`examplepolicy.token`, which means that the payload is responsible for
detecting and handling changes to that file. In contrast, the `template` stanza
for `client.crt` is configured so that Nomad will restart the task whenever
the certificate is reissued, as indicated by `change_mode = "restart"`
(which is the default value for `change_mode`).


### Vault Namespace

Expand Down

0 comments on commit ab4b7e8

Please sign in to comment.