The "template('tomcat/context.xml.erb')" is taken as a literal string when read
from hiera.
In this case you might wrap the file in a define to use the puppet template()
function:
define mymodule::hieratesting ( $content ) {
file { $name:
content => template($content),
}
}
create_resources('mymodule::hieratesting', 'tomcat::confs')
On Thu, Jun 19, 2014 at 06:29:44AM -0700, Darren Claughton wrote:
> Hi,
> I am trying to use create_resources with hiera.
> My hiera testing.yaml (snippet) looks like this
> tomcat::confs:
> "%{hiera('webapps_dir')}/tomcat/conf/context.xml":
> content: template('tomcat/context.xml.erb')
> tomcat::default_confs:
> ensure: present
> owner: "%{hiera('tomcat::user')}"
> group: "%{hiera('tomcat::group')}"
> And my manifest (snippet) looks like this
> create_resources(file, hiera('tomcat::confs'),
> hiera('tomcat::default_confs'))
> Everything is working as it should apart from the fact that when the
> context.xml is created, the content is template('tomcat/context.xml.erb')
> not my actual erb file.
> Thanks,
>
> Darren
>
> --
> 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 [1][email protected].
> To view this discussion on the web visit
>
> [2]https://groups.google.com/d/msgid/puppet-users/64a173c1-cdbc-4647-b7e9-551267969454%40googlegroups.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:[email protected]
> 2.
> https://groups.google.com/d/msgid/puppet-users/64a173c1-cdbc-4647-b7e9-551267969454%40googlegroups.com?utm_medium=email&utm_source=footer
> 3. https://groups.google.com/d/optout
--
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/20140619183440.GB5690%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.