I am learning puppet and setting up modules for some servers.  Although I know 
this works from my testing, my spidey sense is tingling, and I want to know if 
what I am doing is "right."

Say I have 10 servers that use ntp, and company policy is that only two of 
them can contact outside sources to get their time sync, thus, these two 
servers will then be used by the other 8 servers for their time sync.  
Therefore the difference between the 2 servers and the other 8 will basically 
be the contents of /etc/ntp.conf

I created an ntp module, and in init.pp, I have:

   class ntp {
   
   package { <package stuff> }
   
   file { "/etc/ntp.conf":
                owner => "root",
                group => "root",
                mode => 440,
                source => "puppet:///ntp/ntp.client.conf",
                require => Package["ntp"],
   }
   
   service { <service stuff> }
   }

Then I made server.pp that contains

   class ntp::server inherits ntp {
   
   File["/etc/ntp.conf"] { source => "puppet:///ntp.server.conf" }
   
   }

Then in nodes.pp, it boils down to:

   node basenode { include ntp, ssh, yum }
   
   node ntpserver1 inherits basenode { include ntp::server }
   node ntpserver1 inherits basenode { include ntp::server }
   
   node default inherits basenode { }

So basically, all the servers include ntp, but then the "ntpservers" also 
include ntp::server.  So is this the correct approach, that is to include a 
module for all the servers, then overwrite a few server configs using 
inheritance where necessary? 

Thanks.

-- 
Jacob Albretsen
[email protected]
http://blog.knine.net/

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to