Created
January 30, 2012 14:42
-
-
Save jedi4ever/1704761 to your computer and use it in GitHub Desktop.
Puppet puzzle : parametrized classes - common logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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