hello,

----- "Aurelien Degremont" <aurelien.degrem...@cea.fr> wrote:

> How do you deal with a file, like /etc/sysconfig/network which have
> content composed from 
> different aspects (could be network, nfs, nis, ...). So managed by
> various modules but all 
> of them should add its own stuff to the same file.

In the case of sysconfig files you'd need something clever, what if say 2 
modules tried to set HOSTNAME= or any of the other variables, which one would 
win? it would not be predictable.  A lens or custom type would be best.

However, in many cases a simple snippet based system will do what you want, for 
example my MOTD files advertise which modules are on the machine and I do this 
using my concat snippets defined type [1]

define motd::register($content = "", $order = 10) {
   concat_snippet{"motd_${name}":
       owner           => root,
       group           => root,
       directory       => "/etc/motd.d",
       content         => "\t\t- ${msg}\n",
       order           => $order,
   }
}


class named::master {
   motd::register{"bind master server": }
}


and the end result is something like:

        Puppet Modules:
                - apache
                - bind master server
                - iptables


1 - http://nephilim.ml.org/~rip/puppet/concatfile/

-- 
R.I.Pienaar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to