<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 25/03/2014 02:27, Chris wrote:<br>
    </div>
    <blockquote cite="mid:20140325012705.GA426@desktop.deksai.com"
      type="cite">[...]
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">
Another question is how to trigger rules based on the outcome of other
rules.  Perhaps I haven't looked closely enough, but is this possible
out of the box or does that require something custom to glue things
together?
</pre>
        </blockquote>
      </blockquote>
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">Do you have an example of what you need ? I'm not sure I understand what
you need here.
</pre>
      </blockquote>
      <pre wrap="">
I suppose it would map directly to something like 'classes => if_ok("no_problem")'.
It would be different than what I explained above because it wouldn't be
information you would want in inventory, and could change very quickly.
So a simple example would be restarting a service based on file changes.
As I understand it, a directive would need built in support to run
something after a change.  I was wondering if there were a more free form way
to define dependencies.
</pre>
    </blockquote>
    <br>
    <br>
    OK, I think I see what you want. <br>
    I fear that, as you said, you will have to build that logic
    intra-technique, and it's typically what we do for restarting a
    service when it's config file changed (for ex., see the openssh
    server technique). And has technique are (or should be/were thought
    to be) closed components, independant from each others, building
    cooperation between them is for now ad-hoc, and can be fragile.  <br>
    <br>
    But I believe I can help you nonetheless. As we thought that kind of
    things should be simple and built-in, we start ncf (
    <a class="moz-txt-link-freetext" href="http://www.ncf.io/">http://www.ncf.io/</a> ), an abstraction, component-based framework
    based on CFEngine, and it is (starting to) be integrated with
    Rudder. <br>
    <br>
    With ncf, you can do something like that:<br>
    <pre><span class="k">    bundle</span> <span class="k">agent</span> <span class="nf">ntp</span> <span class="p">{</span>
  <span class="k">    </span><span class="kd">methods</span><span class="p">:</span>
    <span class="s">    "package"</span> <span class="kr">usebundle</span>  <span class="o">=></span> <span class="nf">package_install</span><span class="p">(</span><span class="s">"ntp"</span><span class="p">);</span>
    <span class="s">    "config"</span>  <span class="kr">usebundle</span>  <span class="o">=></span> <span class="nf">file_from_template</span><span class="p">(</span><span class="s">"ntp.conf"</span><span class="p">,</span> <span class="s">"/etc/ntp.conf"</span><span class="p">);</span>
        <span class="s">"reload"</span>  <span class="kr">usebundle</span>  <span class="o">=></span> <span class="nf">service_restart</span><span class="p">(</span><span class="s">"ntp"</span><span class="p">),</span>
                  <span class="kr">ifvarclass</span> <span class="o">=></span> <span class="s">"file_from_template__etc_ntp_conf_repaired"</span><span class="p">;</span>
    <span class="s">    "running"</span> <span class="kr">usebundle</span>  <span class="o">=></span> <span class="nf">service_ensure_running</span><span class="p">(</span><span class="s">"ntp"</span><span class="p">);</span>
<span class="p">    }</span></pre>
    <br>
    the class "<span class="s">file_from_template__etc_ntp_conf_repaired</span>"
    if named by concention and automatically raised by <span class="nf">"file_from_template</span><span
      class="p"></span>" when needed. <br>
    <br>
    Is this that kind of thing you want ?<br>
    <br>
    <div class="moz-signature">-- <br>
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <style type="text/css"><!--
    a.redlink:link { color: #962322; text-decoration: none; }
    a.redlink:visited { color: #962322; text-decoration: none; }
    .sig { font-family: sans-serif; font-size: small; }
    .sigsmall { font-family: sans-serif; font-size: x-small; }
  --></style>
      <table border="0" cellpadding="0" cellspacing="2" width="380">
        <tbody>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
          <tr>
            <td colspan="2"><b><img alt=""
                  src="cid:part1.01070109.08090102@normation.com"
                  align="left" hspace="10" width="50" height="50"> <span
                  class="sig">François ARMAND</span></b><br>
              <span class="sig"><i>Directeur de la R&D</i></span><br>
              <span class="sig"><a class="redlink"
                  href="http://www.normation.com">Normation</a></span> </td>
          </tr>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
          <tr>
            <td colspan="2"><span class="sigsmall"><b>87 rue de Turbigo,
                  75003 Paris, France</b></span></td>
          </tr>
          <tr>
            <td><span class="sigsmall">Telephone:</span></td>
            <td><span class="sigsmall">+33 (0)1 83 62 99 23</span></td>
          </tr>
          <tr>
            <td><span class="sigsmall">Mobile:</span></td>
            <td><span class="sigsmall">+33 (0)6 63 37 60 55</span></td>
          </tr>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>