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
On 11/18/2013 03:33 PM, erkan yanar wrote:
> Doing create_resources('file',hiera_hash('input'))
> works great for some hiera like
> input:
> /tmp/a.txt:
> owner: root
> ensure: file
> ...
>
> Im not able to put any template() stuff in there
> input:
> /tmp/a.txt:
> owner: root
> ensure: file
> content: template("create_re/aha.erb")
>
> Instead of doing the template lookup. The content of the file is
> 'template("create_re/aha.erb")'
>
> Any way to dynamically (hiera) define the templates?
>
>
> Regards
> Erkan
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/528DE7FA.5090408%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.