Is it possible to determine the destination path while a template's being rendered?
file { 'my_cool_file':
path => '/etc/somewhere',
content => template('coolmodule/coolfile.erb'),
}
file { 'another_file':
path => '/root/another_file',
content => template('coolmodule/coolfile.erb')
}
<%-# this is coolmodule/coolfile.erb -%>
# this file's placed at <%= scope.lookupvar(' XXX magic to come here ') %>
So the file placed at /etc/somewhere
states # this file's placed at /etc/somewhere
and the one at /root/another\_file
says /root/another\_file
accordingly?