Skip to content

Instantly share code, notes, and snippets.

@cwarden
Created December 6, 2011 19:30
Show Gist options
  • Select an option

  • Save cwarden/1439570 to your computer and use it in GitHub Desktop.

Select an option

Save cwarden/1439570 to your computer and use it in GitHub Desktop.
class mod::config($param) {
}
class mod::uses_config {
# Why hasn't $mod::config been evaluated yet?
$var = $mod::config::param
notify { $var: }
}
Class['mod::config'] -> Class['mod::uses_config']
class mod::main($config) {
$hash = {
'mod::config' => $config
}
# add mod::config to the catalog with parameters
create_resources('class', $hash)
class { 'mod::uses_config': }
}
class {
'mod::main':
config => {
param => 'doot'
}
}
class config {
$x = 'abc'
}
class uses_config {
Class['config'] -> Class['uses_config']
$x = $config::x
notify { $x: }
}
include uses_config
include config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment