Hi,
tough call. You may have to replicate the file type in a defined type
like so:
define my_file($owner="root",$mode="644",...,$template="") {
if $template { File[$name] { content => template($template) } }
file { $name: owner => $owner, ... }
}
Then you can create_resource('my_file',hiera('input')) and pass an
actual "template" parameter to your define.
Lots of work, but I feel that at some points, many if not most users
likely feel the need to wrap the file type this way.
HTH,
Felix