Skip to content

Commit

Permalink
Merge pull request #1735 from tvoran/docs/pkiCert-writeToFile
Browse files Browse the repository at this point in the history
docs/pkiCert: adding a writeToFile example
  • Loading branch information
roncodingenthusiast authored Jun 6, 2023
2 parents e97a929 + e02be84 commit a284056
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/templating-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,18 @@ CA+Chain: {{ .Data.ca_chain }}
{{ end }}
```

The `writeToFile` function can be used with pkiCert to write your Key and Certs
to separate files from a template.

```golang
{{- with pkiCert "pki/issue/my-domain-dot-com" "common_name=foo.example.com" -}}
{{ .Cert }}{{ .CA }}{{ .Key }}
{{ .Key | writeToFile "/my/path/to/cert.key" "root" "root" "0400" }}
{{ .CA | writeToFile "/my/path/to/cert.pem" "root" "root" "0644" }}
{{ .Cert | writeToFile "/my/path/to/cert.pem" "root" "root" "0644" "append" }}
{{- end -}}
```

### `service`

Query [Consul][consul] for services based on their health.
Expand Down

0 comments on commit a284056

Please sign in to comment.