Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
Created January 30, 2012 14:42
Show Gist options
  • Save jedi4ever/1704761 to your computer and use it in GitHub Desktop.
Save jedi4ever/1704761 to your computer and use it in GitHub Desktop.
Puppet puzzle : parametrized classes - common logic
#First class = role web (calls logstash::common to setup directory structure)
class logstash::web(
$version = '1.1.0beta8'
) {
class {'logstash::common':
version => $version
}
}
#Second class = role shipper (calls logstash::common to setup directory structure)
class logstash::shipper(
$version = '1.1.0beta8'
) {
class {'logstash::common':
version => $version
}
}
# Now on the same node:
class {'logtash::web':}
class {'logtash::shipper':}
#---> this will tell me I'm redefining class 'logstash::common'. Fair enough
# The solution I found is to use include logstash::common
# But that doesn't allow me to use params? just include
# Is there something like virtualized classes ?
# Or maybe I need to move my classes to defines?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment