On Mar 6, 2012, at 7:51 AM, chris_sny...@sra.com wrote:

> Crap.  I'm trying to dump Bcfg2 and move to something reasonable.  But so 
> far, all my initial assumptions and patterns for Puppet fail.  I think in 
> terms of heirarchy and inheritence for my systems (all nodes install a core 
> set of packages, some have exceptions for those core set of packages, etc) 
> and as best as I can understand it Puppet's DSL really wants me to create a 
> set of flat, non-hierarchial, non-inheritable set of nodes/classes. And for 
> me that's completely un-managable.  
> 
> I'm reviewing the Puppet-user archives now and I'm seeing a lot of people 
> with similar problems but no good patterns for solutions.
> 
> I want to be able do something like this (hierarchial, inheritance with 
> overloading):
> 
> class base {
>    package { 'sshd' : ensure => present }
>    package {'ntp:      ensure => present }
> }
> 
> node a,b,c {
>    class { 'base' : }
> }
> 
> node d {
>    class { 'base' : }
>    Package{'sshd': ensure => false }   
> }
> 
> What I'm afraid I have to do is this (flat, redefine lots of nodes and 
> duplicate data):
> 
> class base 
>    package {'ntp:      ensure => present }
>    # More common packages defined
> }
> 
> node a,b,c {
>    class { 'base' : }
>    package { 'sshd' : ensure => present }
> }
> 
> node d {
>    class { 'base' : }
>    package { 'sshd' : ensure => false}
> }
> 
> or worse (sometype of parameter passing in the worst, un-managable way):
> 
> class base ( # list ever possible ensure parameter, etc ) { 
>    package { 'sshd' : ensure => $ssh_ensure }
>    package {'ntp:      ensure => $ntp_ensure }
>    # More common packages defined
> }
> 
> node a,b,c {
>    class { 'base' : }}
> }
> 
> node d {
>    class { 'base' : ssh_ensure => false}
> }
> 
> 
> I'm  open to any and all suggestions.
----
I use theforeman which has an ENC that allows nested classes (called hostgroups 
in Foreman) so I have a 'base' class and many 'groups' which are pre-defined 
collections of what you call the flat modules. Nesting is definitely permitted 
and useful in Foreman.

Craig

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