Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can you use automatic parameter lookup with defined types?

Automatic Parameter Lookup (https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup) allows me to have class parameters that are overridden by hiera values. Can anything similar be done with hiera? For example, when using apache::vhost, it's fairly common for me to start with:

apache::vhost{ 'site':
  port => 443,
  ...
}

Setting $apache::vhost::port has no effect. Other than creating another defined type that wraps around apache::vhost, how can I set the default without peppering classes with Apache::Vhost{ port => 443 }?