On Thu, Jun 25, 2009 at 8:39 AM, Don<d...@blacksun.org> wrote:
>
>> couple of nodes that need a different configuration. So what I need to do on
>> these particular nodes are, as far as I know, one of these things:
>> 1) Find a way to override the NTP configuration defined in the base node
>> 2) Make sure they don't inherit the base node, so that I can define a
>> different NTP configuration here
> I literally just asked this same question and the solution is less
> than stellar.
>
> Node inheritance is useful for variables and overriding. Classes are
> useful for specifying system roles.
>
> In more concrete terms this is what I do:
> class roles::general {
>  include ntp
>  include ldap
> }
>
> class roles::ntpserver {
>  include ntp::master
> }
>
> node zone-global {
>  ntp_servers = ['']
> }
>
> node zone-nyc inherits zone-global {
>  $ntp_servers = ['10..1.1.10']
> }
>
> node client inherits zone-nyc {
>  include roles::general
> }
>
> node ntpmaster inherits zonenyc {
>  $ntp_servers = ['pool.ntp.org']
>
>  include roles::general
>  include roles::ntpmaster
> }
>
> This isn't nearly as clean as it could be if some of the variable and
> scoping rules were different, but for now it has sufficed to clean up
> my puppet config dramatically.
>
I just found this on the wiki and it may help out in this problem:

class base_class {
    define testvar_file($myvar="bob") {
         file { $name:
             content => template("john.erb"),
         }
    }
    testvar_file { "/tmp/testvar": }
}

class child_class inherits base_class {
    Base_class::Testvar_file["/tmp/testvar"] { myvar => fred }
}

it is at http://reductivelabs.com/trac/puppet/wiki/CommonMisconceptions
under Class Inheritance and Scope.

Evan

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

Reply via email to