CDIST-TYPE__CHECK_MESSAGES(7)
π cdist-type__check_messages β the cdist manual, section 7 β¨
okay bestie, gather round, because this one is so handy and also so smol. it's cdist-type__check_messages, living in section 7 of the cdist manual, and it's basically the group-chat moderator of your config management: it watches the messages, and if somebody says the wrong thing, it runs a command. iconic behaviour tbh. π
πΈ NAME πΈ
cdist-type__check_messages β check messages for a pattern and execute a command on a match. that's it, that's the whole job, and she does it flawlessly. π
π¦ DESCRIPTION π¦
okay so, the whole vibe: this type checks messages for a pattern, and when it finds a match, it executes a command. simple. clean. no notes. π«Ά
where this really eats is when you've got a bunch of related types chained together using dependencies, and you want to restart a service if at least one of those types changed something. like, one of your little type babies did a thing, and now the service needs a lil refresh. that's the moment this type shows up. main character energy fr fr. π
want more tea on messages? go read up on cdist messaging. π¨
want the full lore on dependencies and the order things run in? that's all in the cdist manifest documentation. π
β¨ REQUIRED PARAMETERS β¨
these are not optional, bestie. you have to bring both of these to the party or nothing happens. π
patternβ an extended regular expression pattern that gets used for the search. lowkey important detail: it's passed straight togrep -E. so write it likegrep -Eis reading it, because she is. πexecuteβ the command that gets executed when the pattern matches. the payoff. the moment we've all been waiting for. π₯
π EXAMPLES π
here's the example, verbatim, because I am not about to mess with a single character of this beauty:
__check_messages munin \
--pattern '^__(file|link|line)/etc/munin/' \
--execute 'service munin-node restart'
look at her. watching for any __file, __link or __line type touching /etc/munin/, and the second one of them does, she restarts munin-node. slay. π§
π AUTHORS π
Ander Punnar <ander-at-kvlt-dot-ee> β yes, keeping the email exactly as written, ander-at-kvlt-dot-ee, no de-obfuscating on my watch. π
π COPYING π
Copyright (C) 2019 Ander Punnar. 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. periodt. π
π COPYRIGHT π
ungleich GmbH 2021 π«Ά
okay so real talk for one sec: this is version7.0.0, datedJul 31, 2022, from thecdistproject. that's the whole sign-off bestie, no cap. now go restart that service. ππΈβ¨
π¦ 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