<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 24/08/2015 18:23, Julien Escario
      wrote:<br>
    </div>
    <blockquote cite="mid:55DB44FC.6000204@azylog.net" type="cite">
      <pre wrap="">Le 24/08/2015 17:43, Nicolas Charles a écrit :
</pre>
      <blockquote type="cite">
        <pre wrap="">The workaround I can suggest is to use the command

! /usr/bin/apt-get -s upgrade | /bin/grep Inst|wc -l

which would do the same.
</pre>
      </blockquote>
      <pre wrap="">
OK, works exactly as expected. Got a big red error, just how I like them ;-)

</pre>
      <blockquote type="cite">
        <pre wrap="">The consequence will be that the Directive will return status:

  * Repaired if there are no package to upgrade
  * Error if there are packages to upgrade

The logic is that command_execution will return status "Repaired" for exit code
0, and "Error" for non exit code 0


Does that do what you want ?
</pre>
      </blockquote>
      <pre wrap="">
Yup, more or less. It would be nice to be able to report something else than 0
or 1. To comply with directive, a 'threshold' should be added.

But I'm perhaps far from the concept of rudder.

At least, I have an information about system being up-to-date or not. Added with
a few packahe version check for critical packages (openssl, bind, ssh, ...), I
think we'll be able to get a start of what we need.

Lemme check this a couple hours more and I'll come back with more questions
about how to do this or that ;-)

Thanks for your help,
Julien

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rudder-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rudder-users@lists.rudder-project.org">rudder-users@lists.rudder-project.org</a>
<a class="moz-txt-link-freetext" href="http://www.rudder-project.org/mailman/listinfo/rudder-users">http://www.rudder-project.org/mailman/listinfo/rudder-users</a>
</pre>
    </blockquote>
    <br>
    <br>
    Hello, <br>
    <br>
    I'm not sur about what you want exactly, but is failry easy to add
    new generic method, tailored for you need. Typically, if the
    "command" methods doesn't do what you want, you could add your own,
    that handle return code differently, and reports more preciselly
    what are the packages not up to date. Actually, you could even add a
    "is_system_up_to_date" method that is success if everything up to
    date, error if not, BUT alse report all the packages not up to date.
    <br>
    <br>
    <br>
    There is some example here of generic methods I created for some
    demo: <a class="moz-txt-link-freetext" href="https://gist.github.com/fanf/83ade79362bf51c44465">https://gist.github.com/fanf/83ade79362bf51c44465</a><br>
    (I'm not a CFEngine expert at all (that's Nicolas and Benoit and
    others), mainly used copy&paste from other generic methods :)<br>
    <br>
    Don't hesitate if you want more information about how to add
    methods, or if you have some specs for your need and don't know how
    to transform them in methods. <br>
    <br>
    Hope it helps, <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: #1782E6; text-decoration: none; }
    a.redlink:visited { color: #1782E6; text-decoration: none; }
    .sig { font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif; font-size: small; }
    .sigsmall { font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif; font-size: x-small; }
  --></style> <a href="https://www.normation.com/fr/"><img alt="Nouveau
          site web Normation"
          src="cid:part1.03070100.09080504@normation.com">
        <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:part2.05070405.02070209@normation.com"
                    align="left" height="50" hspace="10" width="50"> <span
                    class="sig">François ARMAND</span></b><br>
                <span class="sig"><i>Co-founder & CTO</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>
      </a></div>
  </body>
</html>