Issue #4359 has been updated by Adrian Rixon.
I am currently writing a template that needs access to some other files within
the module. I am going to use something like:
<pre>
scope.lookupvar('::settings::confdir') + '/modules/' + module_name +
'/files/...'
</pre>
but it would be nice if there were something cleaner and more canonical (since
this doesn't take modulepath into account).
----------------------------------------
Feature #4359: a way for a template to get its own name, and the directory in
which it resides
https://projects.puppetlabs.com/issues/4359#change-60946
Author: Alan Barrett
Status: Accepted
Priority: Normal
Assignee:
Category: functions
Target version:
Affected Puppet version: 0.25.5
Keywords:
Branch:
I'd like templates to be able to output things like "This file was generated by
puppet using the template <%= template_filename %>". For this, I'd need puppet
to provide some sort of $template_filename variable.
I'd also like templates to be able to make decisions based on the existence of
files with particular names in the module's "templates" or "files" directory.
(Things like "if filename.$fqdn exists then paste its contents here".)
For this, it would be sufficient for puppet to chdir to the template directory,
and let the template use ruby code to discover everything else. I thought
there was already a feature request to chdir to the template directory, but I
can't find it.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.