On Tue, Aug 31, 2010 at 11:35 AM, Thomas Bellman <bell...@nsc.liu.se> wrote: > On 2010-08-31 17:21, Marc Zampetti wrote: > >> I cannot do: >> >> file { "file.conf" : >> content => [ template("module/file.conf.${hostname}"), >> template("module/file.conf.$ >> {groupname}"), >> template("module/file.conf")] >> } > > You can use the file() and inline_template() functions in combination: > > $tmpl = file("/etc/puppet/modules/mymodule/file.conf.${hostname}", > "/etc/puppet/modules/mymodule/file.conf.${groupname}", > "/etc/puppet/modules/mymodule/file.conf") > file { > "file.conf": > content => inline_template($tmpl); > }
You could also do this directly in the ERB template itself using File.exists? and __FILE__ as a reference point. This feels like a hack though. template() already supports concatenation, so it would be difficult to add a feature to "search" for the right file, but it would also be possible to implement a custom function to do this. -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.