I would like modify service attributes based on a hiera lookup. So far I have tried the following and get an Invalid value "$foo::params::foo_ensure" Valid values are stopped and running." If this is a terrible way to do this, then what would you suggest?
class foo::params {
$manage_foo = hiera('foo::active', false)
if $manage_foo {
$foo_enable = true
$foo_ensure = 'running'
}
else {
$cups_enable = false
$cups_ensure = 'stopped'
}
}
class foo {
include foo::params
service {'foo':
ensure => '$foo::params::foo_ensure',
enable => '$foo::params::foo_enable',
}
Many thanks from a puppet rookie!