试图做这样的事情:
# nodes.pp
node 'dev-a-1.sn1.vpc1.example.com' inherits project_j1n_sn1_vpc1_dev {
class { 'custom::core':
overrides => {
'openssh' => {'settings' => {'external_access' => 'true'}}, # Allow direct mounting for dev
'rsyslog' => {'settings' => {'role' => 'node', 'filters' => {'php' => {'target' => 'remote'}, 'mail' => {'target' => 'remote'}}}}
}
}
}
# custom::core
class custom::core($overrides = {}) {
if (has_key($overrides, 'openssh')) {
$settings = $overrides['openssh']['settings']
# Doesn't work
create_resources('openssh', $settings)
# Doesn't work
class { 'openssh': $settings }
}
}
是否可以调用一个类并将散列作为参数传递?
Puppet/Puppetmaster v2.7.26-1 (Centos 6.7)
最佳答案
关于Puppet - 将哈希作为类参数传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33442533/