Am 04.06.2010 18:34, schrieb Dan:
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?
The simplest way would be to use class inheritance and override the
source of the file:
class extended inherits base {
File["/etc/hosts.allow"]{source => ...}
}
A more maintainable way would be to manage the file's content more
fine-grained than that. Look into the "augeas" type whether there is a
lens to manage that syntax. Then you could use a simple define to wrap
this all nicely into a resource you can use:
define hosts_allow(...) {
augeas {...}
}
class base {
hosts_allow { ... }
}
class other_stuff {
hosts_allow { ... }
}
Best Regards, David
--
dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at
Klosterneuburg UID: ATU64260999
FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg
--
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.