Hello lovelies,

Our team is deliberating a few different options for the hierification of our 
modules; and wanted to poll the collective genius before making our decision.

As we all know, there are certain attributes of a package which are, by 
default, consistent on an OS... say, the name of a package.....

class foobar {
include foobar::params
  $package = $foobar::params::package
  Package {$package:
    ensure => installed
  }
}

class foobar::params {
case $osfamily:
  redhat: {
    $package = 'foobar'
  }
  debian: {
    $package = 'foobard'
  }
  default: {
    fail
  }
}


well, we want to be able to overide those defaults with hiera:

class foobar {
include foobar::params
  $package = $foobar::params::package
  Package {$package:
    ensure => installed
  }
}

class foobar::params {
case $osfamily:
  redhat: {
    $package = hiera('foobar_package','foobar')
  }
  debian: {
    $package = hiera('foobar_package','foobard')
  }
  default: {
    fail
  }
}


which is great, except now the package name is wrong by default on debian 
boxes...

now sure, I can argue that my hierarchy should have places to logically 
separate out and override those 'inconvenient' defaults, ie for an environment 
that uses debian...

one of our engineers suggested the following paradigm:


class foobar {
include foobar::params
  $package = $foobar::params::package
  Package {$package:
    ensure => installed
  }
}

class foobar::params {
case $osfamily:
  redhat: {
    $package = hiera('foobar_os_rhel_package','foobar')
  }
  debian: {
    $package = hiera('foobar_os_deb_package','foobard')
  }
  default: {
    fail
  }
}

which makes our topmost hierarchy (which is not segregated by OS, because the 
relevant hierarchies doen't split very cleanly at the OS level.) a little more 
bloated:

foobar_os_deb_package: 'foobard'
foobar_os_rhel_package: 'foobar'


but makes for less overriding and additions for "default" setups...


to be honest, I'm not sure which idea (or what other as yet unthought of idea) 
has the most merit, and I'd love to hear your thoughts on the matter before we 
get too much further


Thanks so much in advance


Wolf Noble

________________________________

This message may contain confidential or privileged information. If you are not 
the intended recipient, please advise us immediately and delete this message. 
See http://www.datapipe.com/legal/email_disclaimer/ for further information on 
confidentiality and the risks of non-secure electronic communication. If you 
cannot access these links, please notify us by reply message and we will send 
the contents to you.

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