32. cdist-type__consul_template_template(7)

Manage consul-template templates

Steven Armstrong <steven-cdist--@--armstrong.cc>

32.1. DESCRIPTION

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.

32.2. REQUIRED PARAMETERS

destination
the destination where the generated file should go.

32.3. 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’.

32.4. 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 \
   --source-file "$__manifest/files/nginx.ctmpl" \
   --destination /etc/nginx/nginx.conf \
   --command 'service nginx restart'

32.6. COPYING

Copyright (C) 2015 Steven Armstrong. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3).