Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Set File content via Hiera


I am looking for the syntax to set the content for a File resource from hiera. Specifically I want to set the template being used:

# Puppet
class test (
  $file_content = undef,

    ensure  => file,
    content => $file_content,


# Hiera
test::file_content: template('modules/test/test.erb')

Since Hiera is returning a string, the template function is not being evaluated.

I am pretty sure I saw this being done somewhere, but I cannot figure out the correct syntax anymore.