carta
cdist-type__consul_template_template(7)

cdist-type__consul_template_template7

Manage consul-template templates

Overview

Generate and deploy template definitions for a consul-template. See https://github.com/hashicorp/consul-template#examples for documentation. Templates are written in the Go template format. Either the --source or the --source-file parameter must be given.

Required parameters

destination

the destination where the generated file should go.

Optional parameters

command

an optional command to run after rendering the template to its destination.

source

path to the template source. Conflicts --source-file.

source-file

path to a local file which is uploaded using the __file type and configured as the source. If source is '-' (dash), take what was written to stdin as the file content. Conflicts --source.

state

if this template is 'present' or 'absent'. Defaults to 'present'.

wait

The minimum(:maximum) time to wait before rendering a new template to disk and triggering a command, separated by a colon (:). If the optional maximum value is omitted, it is assumed to be 4x the required minimum value. This is a numeric time with a unit suffix ("5s"). There is no default value. The wait value for a template takes precedence over any globally-configured wait.

Examples

# configure template on the target
__consul_template_template nginx \
   --source /etc/my-consul-templates/nginx.ctmpl \
   --destination /etc/nginx/nginx.conf \
   --command 'service nginx restart'
# upload a local file to the target and configure it
__consul_template_template nginx \
   --wait '2s:6s' \
   --source-file "$__manifest/files/nginx.ctmpl" \
   --destination /etc/nginx/nginx.conf \
   --command 'service nginx restart'

Copying

Copyright (C) 2015-2016 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

History

  • Debian 13 (Trixie): the text shown here
  • Debian 12 (Bookworm)
  • Debian 11 (Bullseye)
  • Debian 10 (Buster)
  • Debian 9 (Stretch)

Authors

Steven Armstrong <[email protected]>

From cdist 7.0.0-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.