<div dir="ltr"><div><div><div><div><div><div>Hello guys,<br><br></div>Here are my 2 cents for the command-line :<br></div>- make the help available from any argument and coherent, ex : "rudder agent help" and "rudder help agent" should return the same information <br></div>- standardize debug flag (-d and/or --debug  for example) and make it applicable through all levels (any nested script should respect debug flag)<br></div>- it does exist so : do NOT use information from headers inside the script, it mixes comments and code logic (see Debian apache2 modules dependencies or LSB init script)<br></div>- be careful to any dependency added (rsync for example in the pull request) <br></div>- standardize common flags for each script so external contributions will be homogeneous (-d for debug, -v for verbose, etc)<br><div><br></div><div>Jean<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 21, 2014 at 11:59 AM, Francois Armand <span dir="ltr"><<a href="mailto:francois.armand@normation.com" target="_blank">francois.armand@normation.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello guys, <br>
    <br>
    In Rudder 3.0, we want to add a command to manage Rudder Agent. <br>
    The main idea is to let the user have an unique entry point to do
    all the common stuff (running the agent now, in debug, updating its
    policies, sending an inventory, etc) with a sensical and harmonized
    naming scheme. <br>
    <br>
    So, that's for the big picture, now for some more ideas we wanted to
    share to get feedback early, because, well, we really want to make
    the Rudder user life easier, so it seems to make sense to ask what
    they are thinking about that :)<br>
    <br>
    <br>
    <b>Main goals for now:</b><br>
    <ul>
      <li>we have a main command with (at least) two sub-context (agent
        and server) allowing to interact with these components<br>
      </li>
      <li>the main cli must be an an extensible command wrapper so that
        it is esay to add new command</li>
      <li>each command should be writtable in any language (shell and
        python come to mind)</li>
      <li>the commands should be discoverable from the cli without any
        other reference outside</li>
      <ul>
        <li>(I refreigned to use intuitive, but its behavior really must
          seem natural and logic for any sysadmin used to unix)<br>
        </li>
        <li>we have convention about the behavior of sub-command so that
          there is little suprise from one to an other (not git like :)</li>
        <li>each sub-command embed a description of its goal so that
          it's easy to display a summary at the top level<br>
        </li>
      </ul>
    </ul>
    <br>
    <br>
    <b>Current state and technical details:</b><br>
    <br>
    We have a proto working for the agent and a very little subset of
    commands. The code will be available in repo
    <a href="https://github.com/Normation/rudder-agent" target="_blank">https://github.com/Normation/rudder-agent</a> (you can already look at
    the Pull Request: <a href="https://github.com/Normation/rudder-agent/pull/1" target="_blank">https://github.com/Normation/rudder-agent/pull/1</a>)<br>
    <br>
    There is two main items:<br>
    <ul>
      <li>a directory (/opt/rudder/share/commands) containing individual
        commands, organized as follow:</li>
      <ul>
        <li>each command is in its own executable file</li>
        <li>the file has the naming scheme: [agent|server]-cmd_name</li>
        <li>the file contains an header with the command description<br>
        </li>
      </ul>
      <li>the (python) "rudder" command, that will be located in
        "/opt/rudder/bin/rudder", and is just a wrapper with the
        following behaviour:</li>
      <ul>
        <li>"rudder" => display the general info, let know that you
          can call "rudder [agent|server|help]</li>
        <li>"rudder agent" or "rudder server": list all commands in
          /opt/rudder/share/cli with the correct prefix and for each of
          them, display its description. <br>
        </li>
      </ul>
    </ul>
    <br>
    The current implemented commands are only on rudder agent for now:<br>
    <ul>
      <li>rudder agent enable / disable<br>
      </li>
      <li>rudder agent reinit</li>
      <li>rudder agent reset</li>
      <li>rudder agent inventory</li>
      <li>rudder agent run</li>
      <li>rudder agent update<br>
      </li>
    </ul>
    <div>Hopefully, others will follow - and any
      feedback on that is warmlly welcomed !<br>
      <br>
      Cheers, <br><span class="HOEnZb"><font color="#888888">
      <br>
      -- <br>
      
      
      <table width="380" border="0" cellpadding="0" cellspacing="2">
        <tbody>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
          <tr>
            <td colspan="2"><b><img alt="" src="cid:part1.05020809.08070800@normation.com" width="50" height="50" hspace="10" align="left"> <span>François ARMAND</span></b><br>
              <span><i>Directeur de la R&D</i></span><br>
              <span><a href="http://www.normation.com" target="_blank">Normation</a></span> </td>
          </tr>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
          <tr>
            <td colspan="2"><span><b>87 rue de Turbigo,
                  75003 Paris, France</b></span></td>
          </tr>
          <tr>
            <td><span>Telephone:</span></td>
            <td><span><a href="tel:%2B33%20%280%291%2083%2062%2099%2023" value="+33183629923" target="_blank">+33 (0)1 83 62 99 23</a></span></td>
          </tr>
          <tr>
            <td><span>Mobile:</span></td>
            <td><span><a href="tel:%2B33%20%280%296%2063%2037%2060%2055" value="+33663376055" target="_blank">+33 (0)6 63 37 60 55</a></span></td>
          </tr>
          <tr>
            <td colspan="2">
              <hr></td>
          </tr>
        </tbody>
      </table>
    </font></span></div>
  </div>

<br>_______________________________________________<br>
rudder-dev mailing list<br>
<a href="mailto:rudder-dev@lists.rudder-project.org">rudder-dev@lists.rudder-project.org</a><br>
<a href="http://www.rudder-project.org/mailman/listinfo/rudder-dev" target="_blank">http://www.rudder-project.org/mailman/listinfo/rudder-dev</a><br>
<br></blockquote></div><br></div>