CDIST-TYPE__CON...MPLATE_TEMPLATE(7)

πŸ’– cdist-type__consul_template_template β€” the manual page, bestie edition πŸ’–

okay so this is the cdist type page for cdist-type__consul_template_template, and it's all about making consul-template do your template bidding. sit with me, we're doing this together 🫢


✨ NAME ✨

cdist-type__consul_template_template β€” manage consul-template templates, fr fr πŸ’…


🌸 DESCRIPTION 🌸

bestie, this type generates and deploys template definitions for a consul-template. the actual docs for that live at https://github.com/hashicorp/consul-template#examples if you wanna go read them, no cap.

the templates themselves are written in the Go template format β€” that's the vibe, that's the whole aesthetic.

and listen: you MUST give either the --source parameter or the --source-file parameter. one of them. not neither. it's giving mandatory 🚨


πŸ‘‘ REQUIRED PARAMETERS πŸ‘‘

  • destination β€” the destination where the generated file should go. that's where the magic lands, periodt.

πŸ’… OPTIONAL PARAMETERS πŸ’…

  • command β€” an optional command to run after rendering the template to its destination. like, once it's rendered, go do the thing πŸ”₯
  • source β€” path to the template source. this one conflicts with --source-file, so pick a lane bestie.
  • source-file β€” path to a local file which is uploaded using the __file type and configured as the source. and if source is '-' (dash), take what was written to stdin as the file content. cute. this conflicts with --source, obviously πŸ’€
  • state β€” if this template is 'present' or 'absent'. defaults to 'present'. present is the default, iconic behavior.
  • 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, like "5s". there is no default value β€” so if you want it, you say it. also the wait value for a template takes precedence over any globally-configured wait. main character energy tbh ⭐

πŸ¦‹ EXAMPLES πŸ¦‹

here's the tea, two whole scenarios:

# 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'

like look at that second one, she's got the --wait '2s:6s' in there and everything. obsessed 😭


🌈 SEE ALSO 🌈

go read these next, they're in the same friend group:


πŸŽ€ AUTHORS πŸŽ€

this masterpiece was written by Steven Armstrong <steven-cdist--@--armstrong.cc> πŸ’œ


πŸ“œ 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.


ungleich GmbH 2021


and that's the whole page bestie ✨ this was version 7.0.0, dated Jul 31, from the cdist crew β€” go forth and template, you absolute icon πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from