We're using the roles/profiles pattern. In the example below I'd like to optionally pass a parameter from hiera so that if no value is provided then the ::apache class default is used (which it gets internally from its ::apache::params class). This would enable us to set the keepalive value on some servers but allow the ::apache class to determine the value itself when we don't.
common.yaml
-----------
profiles::apache::keepalive : On
profiles::apache::keepalive_timeout : 5
apache.pp
---------
class profiles::apache {
$apache_keepalive = hiera('profiles::apache::keepalive')
$apache_keepalive_timeout = hiera('profiles::apache::keepalive_timeout')
class {'::apache':
keepalive => $apache_keepalive,
keepalive_timeout => $apache_keepalive_timeout,
}
}
I've tried setting the default value of the hiera lookup to 'undef' but then I end up with empty values in the config.