On Fri, Mar 2, 2012 at 08:56, Romeo Theriault <romeo.theria...@maine.edu> wrote:
> Hi, I'm just getting started with puppet and am looking for some best
> practices on how to handle node and module inheritance issues. I'm
> planning to start using heira so want to plan my implementation around
> hiera specifics.
>
> Specifically, one item I can't seem to find a clean way of dealing
> with is one-off nodes. For example, let's say I want to apply a class
> called zabbix::agent to my whole infrastructure, so I put it in
> common.yaml. But then I find out there are a few nodes that for
> whatever reason I can't apply this class to. Short of just not
> inheriting anything from common.yaml is there a clean way to say
> "inherit everything from common except zabbix::agent"?
>
> How are people dealing with the slight variations in their
> infrastructure? I realize it's possible to code some logic into the
> classes for these specific one-off hosts but that seems really hackish
> and brittle.

After a bit more googling I found this informative puppet-users thread:

http://groups.google.com/group/puppet-users/browse_thread/thread/6b59ae2470acfa14/810eb8671a5b3cdd

which talks about creating special "disabled" classes which inherit
the widely used class and set certain values to 'undef'. This seems
like it's probably the way to go since it's the best method I've
seen/heard of so far to deal with this.


> I think a lot of shops do this by creating special "disabling" classes
> for those one-off systems.  To use your puppetmaster example (untested
> pseudocode ahead):
>        class puppet::client {
>          file { '/etc/puppet/puppet.conf':
>            ensure => present,
>            source => 'puppet:///puppet/configfile',
>          }
>        }
>        class puppet::client::disabled inherits puppet::client {
>          File['/etc/puppet/puppet.conf'] {
>            ensure => undef,
>            source => undef,
>          }
>        }
>        class puppet::server {
>          include puppet::client::disabled
>        }
> Now it's safe to apply puppet::client to all your nodes, including
> your puppetmaster, because the ::disabled class will override the
> management of puppet.conf on the puppetmaster (which presumably
> includes the puppet::server class).



Anyone else dealing with this in a different way?

Thanks,
Romeo



--
Romeo

-- 
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