[Puppet Users] Re: node, class inheritance confusion

Mike Renfro
Thu, 26 Jun 2008 18:00:43 -0000

On 6/26/2008 11:14 AM, Evan Hisey wrote:

> --------------------------------------------
> Do to quirks in another node I need to change node base to a class
> base. I discovered that nodes can''t inherit class. Not a problem,
and
> it is mentioned in the language tutorial so I tried this setup
> -----------------------------------
> class default-includes{
>                 include base-repos
>                 include ssh-base
>                 include common-root
>                 include puppet
>                }
>
> node base{
>               include default-includes
>
> node ox inherits base{
>               include java
>               }
> -------------------------------------

I''ve got a relatively deep inheritance structure running here. The
abridged version is as follows, and it works for me. The inheritances
are tied to classes, not to nodes.

class cae-host {
     file {
         "/etc/default/puppet":
             source => "puppet:///files/apps/puppet/puppet";
         "/etc/default/portmap":
             source => "puppet:///files/apps/portmap/portmap";
     }
     # Things common to all managed hosts go here -- accurate time,
     # centralized logging, sshd enabled, and automatic update capability
     include timezone-central, ntp, ntpdate
     include sudo, openssh-server, syslog-ng
     include cron-apt
     # other includes and manifest definitions go below
}

class public-host inherits cae-host {
     # A public host needs:
     # - Full list of usernames and uids synced from the file server.
     # - Kerberos password authentication from Active Directory.

     # File definitions go here. Edited for space.
     include active-directory-member
}

class cluster-host inherits public-host {
     # A cluster host needs:
     # - rshd running for Fluent jobs.
     # - torque running for any submitted jobs.
     # - Disabled Kerberos password authentication. Users only get access
     #   via qsub. (FIXME)
     include rsh-server
     # other includes go here.
     package {
         [ "rsh-client", "ansys11", "libg2c0",
           "libnuma1" ]: ensure => latest;
         [ "ansys10" ]: ensure => absent;
     }
}

class pe2650-host inherits cluster-host {
     include pgicdk
     include gaussian
     include openmpi
     include autodocksuite
     gangliaconfig::gangliaclient{
       "pe2650":
           cluster  => "CAE 24-7 Compute Nodes",
           mcast_ip => "239.2.11.73";
     }
}

node ch226-1, ch226-2, ch226-3, ch226-4, ch226-5 {
     include pe2650-host
}

--
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University