Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 75

Lookup destination path of a file in a template.

$
0
0
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?

Viewing all articles
Browse latest Browse all 75

Trending Articles