Why should I use a puppet parameterized class?

Posted by robbyt on Server Fault See other posts from Server Fault or by robbyt
Published on 2011-02-26T22:38:09Z Indexed on 2011/02/27 15:26 UTC
Read the original article Hit count: 213

Filed under:
|

Generally when working with complex puppet modules, I will set variables at the node level or inside a class. e.g.,

node 'foo.com' {
  $file_owner = "larry" 
  include bar 
}

class bar { 
  $file_name = "larry.txt"
  include do_stuff
}

class do_stuff {
  file { $file_name:
    ensure => file,
    owner  => $file_owner,
  }
}

How/when/why does parametrized classes help when this situation? How are you using parametrized classes to structure your puppet modules?

© Server Fault or respective owner

Related posts about linux

Related posts about puppet