<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Benoit,<br>
      <br>
      For your first use case, you can use the variables
      ${rudder.node.hostname} and ${rudder.node.id} 'see
      <a class="moz-txt-link-freetext" href="http://www.rudder-project.org/foswiki/System/ContextedVariables">http://www.rudder-project.org/foswiki/System/ContextedVariables</a> )
      that would refer to the hostname and node id.<br>
      so you could create one file per node, and copy it with Copy from
      the shared folder<br>
      Problem is that you need to have the file existing when you add
      new nodes into Rudder. As you pointed, there is no "default" for
      copy (you are probably refering to the method called single copy
      nirvana in CFEngine), and it is not implemented as it "hides" the
      intent of the configuration<br>
      <br>
      For the Postgres case, i'd define a Group that contains all nodes
      that have default file, and others for specific config file, and
      then use the "Define generic variable" to define where to copy
      from the file, and use the defined variable in the path of the
      file to copy from.<br>
      <br>
      Does it help?<br>
      Nicolas<br>
      <br>
      <br>
      <div class="moz-signature">
        <meta content="text/html; charset=windows-1252"
          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></div>
      Le 19/11/2014 18:35, Benoit LAURENT a écrit :<br>
    </div>
    <blockquote
cite="mid:CAOKNA1tBb-2xxm0RoB2E6tN=PP7MfATZ3SHqqC_ormT_JmAD8g@mail.gmail.com"
      type="cite">
      <pre wrap="">Hello,

I would like deploy with configuration files in my machine.
But if I used Rudder I must create 1 rule for each machine.
I would like to introduce to directives the hostname version.


For example:

In my /var/rudder/shared-files/  I commit one directory by hostname
and I put in configuration files:
tree shared-files
shared-files
        host1
                  mysql.conf
        host3
                  babla.conf
                  postgresql.conf
        hostname43
And after I create directive  "copy shared file." with copy from
shared-files/${HOSTNAME/UUID}/*    TO   /etc/rudder/conf/ .


Other raisoning, I would like to copy to all postgres node groups same
files by "role":
shared-files
             default  <= defaut conf for all nodes
                  mysql.conf
              host3   <= errase conf for host3 node
                  mysql.conf

And after I create directive  "copy shared file." with copy from
shared-files/${AUTOPATH}/*    TO   /etc/rudder/conf/ and rudder try to
copy from shared-files/host3 and if does not exists,
shared-files/default .


It it an example. And I dont know if it is a good raisoning: is it
possible to proceed with other method ?


Regards,
Benoit
_______________________________________________
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>
  </body>
</html>