Skip to content

tutorial for configuring mTLS certs via Vault uses wrong Consul Template #26835

@joshbartley

Description

@joshbartley

Nomad version

Output from nomad version

Operating system and Environment details

Issue

The documentation at https://developer.hashicorp.com/nomad/tutorials/integrate-vault/vault-pki-nomad#prepare-vault uses the incorrect consul templates causing a TLS cert to have unmatched public/private keys

Image

Actual Result

Template should be combined into a single and write the key out according to the comment on the issue below.

hashicorp/consul-template#1597 (comment)

Working template example.

{{ with pkiCert "pki_int/issue/nomad-cluster" "common_name=server.global.nomad" "ttl=24h" "alt_names=localhost" "ip_sans=127.0.0.1"}}
{{ .Data.Cert }}
{{ .Key  | writeToFile "/opt/nomad/rendered-cert-files/server.agent.key" "nomad" "nomad" "0644" }}
{{ end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions