> --
Hi Jeff,
Most of my modules support a bunch of OS's including Debian, EL,
Solaris, Suse and Ubuntu and at different releases. To do this, I have
to encode a lot of default data into the module.
Consider the following pattern. If you do not specify a value for the
package parameter, it will use the default for that osfamily.
class foo (
$package = undef,
) {
case $::osfamily {
'Debian': { $default_package = 'foo2' }
'RedHat': { $default_package = 'foo' }
default: { fail('foo supports EL and Debian osfamilies') }
}
if $package == undef {
$package_real = $default_package
} else {
$package_real = $package
}
package { $package_real:
ensure => 'present',
}
}
Take a look at my ssh module. It is approved by Puppet and works on 13
different platforms and takes into account the processor type for Suse
as you mentioned above.
https://forge.puppet.com/ghoneycutt/ssh/readme
I tend to use case statements for all of the different platforms and
avoid using subclasses such as foo::debian and foo::redhat.
While I generally opt for putting all configuration into the same
template such as with the ssh module, sometimes the platform differences
are quite different, in which case I use platform specific templates.
For an example of this, check out my Puppet approved module for inittab.
https://forge.puppet.com/ghoneycutt/inittab
Best regards,
-g
--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile:
+1.206.414.8658