CDIST-TYPE__CONFIG_FILE(7)
π CDIST-TYPE__CONFIG_FILE π
okay bestie, welcome to cdist-type__config_file β yes that's the manual page name, it lives in section 7 of the cdist manuals, and it's literally the moment your config files stop being a whole thing. π
β¨ NAME β¨
cdist-type__config_file β _Manages config files
like. it manages your config files. that's the whole job. she's focused, she's iconic, she ate. π
πΈ DESCRIPTION πΈ
So here's the tea: this type deploys config files by handing the whole thing off to the file type. That's the engine, this is the vibe. πβ¨
And then β and this is the part that's giving main character energy β it runs the given code if the file changes. Not always. Not on every run. Only when the file actually changes. Conditional queen behavior, no cap. π
π¦ REQUIRED PARAMETERS π¦
None.
Yep. Zero. Nada. You don't have to give her anything. She's low-maintenance like that. π«Ά
π OPTIONAL PARAMETERS π
groupβ seecdist-type__filemodeβ seecdist-type__fileonchangeβ the code to run if the file changes π₯ownerβ seecdist-type__filesourceβ Path to the config file. And here's the cute lil trick: ifsourceis'-'(a dash, yes literally just a dash), then whatever was written to stdin gets taken as the config file content. stdin girlies rise up πstateβ seecdist-type__file
ngl, several of these just point you at cdist-type__file because that's where the real deets live. go read her page too, she's in SEE ALSO bestie, I got you. π
π EXAMPLES π
okay this is the moment. look at her. she's serving:
__config_file /etc/consul/conf.d/watch_foo.json \
--owner root --group consul --mode 640 \
--source "$__type/files/watch_foo.json" \
--state present \
--onchange 'service consul status >/dev/null && service consul reload || true'
like?? owner root, group consul, mode 640, source pulled from "$__type/files/watch_foo.json", state present, and an onchange that checks consul's status and reloads it β and if that check fails it just || trues its way out of drama. no stress. β
π SEE ALSO π
cdist-type__file(7)β go read her, she's the blueprint fr fr
π AUTHORS π
Steven Armstrong <steven-cdist--@--armstrong.cc> π
π COPYING π
Copyright (C) 2015 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.
(that's the legal bit, and yes it's copy-paste-exact, licensing does NOT do vibes-based paraphrasing π)
π COPYRIGHT π
ungleich GmbH 2021
and that's the whole page bestie!! π
β¨ this was version 7.0.0, dated Jul 31, 2022, straight out of the cdist source, page name CDIST-TYPE__CONFIG_FILE(7). go deploy something cute. π¦π mwah.
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms