<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi there,<br>
<br>
<div class="moz-signature">An idea has come up in several
discussions recently: after Rudder has generated promises for a
node, it would be useful to be able to run some commands to either
extend the basic check (cf-promises currently) or perform some
extra operations.<br>
<br>
A few examples:<br>
<br>
<ol>
<li>The obvious one: after generating CFEngine promises, we
often want to validate them with cf-promises.</li>
<li>A similar bonus one: after generating CFEngine promises for
a node, we could check to make sure that any
generic_cfengine_variables used are actually defined too, and
fail if not (this would cause the generation to fail in the
UI, making it easy for a user to find the error)</li>
<li>Add extra data: inject some data file into the generated
promises each time they change, like run a request to get node
properties from Rudder's API and put them in a .csv/.json file
in the promises directory</li>
</ol>
<p><br>
A simple implementation for this would be to create a directory
structure under /opt/rudder/etc/hooks.d/, with sub-directories
for each (future) hook type, the first being
"promise-generation". This way, we could easily add other hook
types later, such as node-first-seen, node-accepted,
node-refused, node-to-relay.<br>
</p>
<p>The files in this directory would be run one by one, after
promise generation, in the exact same way cf-promises is run
today.<br>
</p>
<p>This idea would obviously be implemented in master (see our
release features / bugs policy), but since the cf-promises
command already exists in older versions, it could relatively
easily be implemented in existing versions too.<br>
</p>
<p>Any thoughts, comments, suggestions?<br>
</p>
<p>Jon<br>
</p>
</div>
</body>
</html>