On Fri, Jun 4, 2010 at 11:34 AM, Dan <[email protected]> wrote:
> Most of my machines are pretty cookie-cutter, so I have one class and
> config file setup for different services.  For example, pretty much
> have one hosts.allow that goes out everywhere.  However, there are
> always exceptions.  So I have 3 hosts that have similar configs but
> have more things open, so what's the 'best practice' way to centralize
> those?  Do I really need to create a whole new class and assign that
> one config file to it for one host?

I use a technique approximately like this:

class syslog-ng {

    package { "syslog-ng": ensure => installed }

    file { "/etc/syslog-ng.conf":
        require => Package[syslog-ng],
        source => [ "puppet:///modules/syslog-ng/$hostname/syslog-ng.conf",
                          "puppet:///modules/syslog-ng/syslog-ng.conf" ]
    }
}

Then in the files directory of that module, I have a a
"syslog-ng.conf" at the top level, and subdirectories for each host
that requires a custom configuration.  Puppet first checks to see if
the $hostname subdir exists and, if it doesn't, falls through to the
default config file.

The documentation for the "source" parameter describes how this works
in more detail:

http://docs.puppetlabs.com/references/stable/type.html#source

-Ben

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

Reply via email to