Ask Your Question

Using array in template for file resource

asked 2014-01-24 11:45:20 -0600

Gigi Mathews gravatar image

updated 2014-01-25 02:44:29 -0600

doc75 gravatar image

I am trying to use array in template for file resource

file { "/tmp/":
  content => [template("puppet:///modules/foobar/$hostname.erb"),

I receive following error

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find template 'puppet:///modules/foobar/' at /etc/puppet/modules/foobar/manifests/foobar.pp:16 on node server1.domain.local warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run

What am i doing wrong ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-01-24 15:07:42 -0600

spuder gravatar image

updated 2014-01-25 20:07:14 -0600

Puppet templates have a different syntax than puppet files

Remove puppet:///module from the beginning


Puppet briefly mentions this difference in their learning puppet tutorial, and apologizes for making templates and files have different syntax.

Note that the path to the template doesn’t use the same semantics as the path in a puppet:/// URL. Sorry about the inconsistency. Link

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-24 11:45:20 -0600

Seen: 434 times

Last updated: Jan 25 '14