Backport of update PKI example in template spec with the new pkiCert function into release/1.6.x (#19396)
Co-authored-by: Adrian Todorov <adrian.todorov@hashicorp.com>
This commit is contained in:
parent
1d3a38aae0
commit
22f9867ed3
|
@ -646,8 +646,8 @@ multiple templates watching the same path return the same data.
|
||||||
```hcl
|
```hcl
|
||||||
template {
|
template {
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
{{ with pkiCert "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
||||||
{{- .Data.certificate -}}
|
{{- .Cert -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
EOH
|
EOH
|
||||||
destination = "${NOMAD_SECRETS_DIR}/certificate.crt"
|
destination = "${NOMAD_SECRETS_DIR}/certificate.crt"
|
||||||
|
@ -656,8 +656,8 @@ EOH
|
||||||
|
|
||||||
template {
|
template {
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
{{ with pkiCert "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
||||||
{{- .Data.issuing_ca -}}
|
{{- .CA -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
EOH
|
EOH
|
||||||
destination = "${NOMAD_SECRETS_DIR}/ca.crt"
|
destination = "${NOMAD_SECRETS_DIR}/ca.crt"
|
||||||
|
@ -666,8 +666,8 @@ EOH
|
||||||
|
|
||||||
template {
|
template {
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
{{ with pkiCert "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" }}
|
||||||
{{- .Data.private_key -}}
|
{{- .Key -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
EOH
|
EOH
|
||||||
destination = "${NOMAD_SECRETS_DIR}/private_key.key"
|
destination = "${NOMAD_SECRETS_DIR}/private_key.key"
|
||||||
|
@ -687,10 +687,10 @@ directory.
|
||||||
```hcl
|
```hcl
|
||||||
template {
|
template {
|
||||||
data = <<EOH
|
data = <<EOH
|
||||||
{{ with secret "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" "format=pem" }}
|
{{ with pkiCert "pki/issue/foo" "common_name=foo.service.consul" "ip_sans=127.0.0.1" "format=pem" }}
|
||||||
{{ .Data.certificate }}
|
{{ .Cert }}
|
||||||
{{ .Data.issuing_ca }}
|
{{ .CA }}
|
||||||
{{ .Data.private_key }}{{ end }}
|
{{ .Key }}{{ end }}
|
||||||
EOH
|
EOH
|
||||||
destination = "${NOMAD_SECRETS_DIR}/bundle.pem"
|
destination = "${NOMAD_SECRETS_DIR}/bundle.pem"
|
||||||
change_mode = "restart"
|
change_mode = "restart"
|
||||||
|
|
Loading…
Reference in New Issue