Hi.
I've been reading up on inheritance, parameterized classes and whatnot, and
basically wish to see whether I'm thinking right or if I'm just confused(more
than usual).
I'll use a trivial NFS module as an example since it should cover the basic
questions and has some interesting dependencies.
I have Debian and RedHat(including Scientific Linux, but I'll treat those the
same as RH) boxes, our standard setup disables NFS on these, the occasional box
might have it enabled.
On Debian an NFS server depends on three services, nfs-common,
nfs-kernel-server and portmap. The client depends on nfs-common and portmap.
On Redhat the server depends on nfs and rpcbind, the client on rpcbind. (I'll
note that this is to the best of my knowledge so far since RH didn't bother
documenting NFS particularly well for RHEL 6.x).
The goal is the usual(I would guess), a basic node config that has a baseline
of hardening, ideally I would use this for every other node unless I'm doing
something really different(say setting up a server with intentionally bad
hardening for testing purposes or something).
Nodes would then override this as needed.
I can think of a couple of ways to do this, but having read some of the
conversations on parameterized classes it seems like this is the way forward
and preferred by Puppetlabs. Basically I want to follow best practices and make
sure I make my setup as futureproof as I reasonably can.
I'm on 2.6.x right now but the less I have to rewrite when the time for 2.8 or
even 3.0 comes, the happier I'll be obviously. :)
So what I'm thinking is something like so for nodes:
nodes.pp
----
node basenode {
include nfs ( server=no, client=no )
...
}
node somebox inherits basenode {
...
}
node nfsserver inherits basenode {
include nfs ( server=yes )
...
}
The NFS module would look something like:
init.pp
----
class nfs::params {
OS detection and such.
}
class nfs::install {
install packages as needed, skip entirely pretty much if both server and
client are no.
}
class nfs::config {
configure as needed
}
class nfs::service {
start/stop services based on server/client=yes/no.
}
class nfs ( $server, $client ) {
include nfs::params, nfs::install, nfs::config, nfs::service
}
Does this make sense or am I about to blown my foot off?
Regards
Johan
--
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.