Issue #3939 has been updated by Michael Stahnke.
Description updated
Status changed from Unreviewed to Needs Decision
Assignee set to Nigel Kersten
Affected Puppet version changed from 0.25.5 to 2.7.9
This is absolutely still a bug in 2.7.9.
[root@centos5-64 foo]# cat manifests/init.pp
class foo {
$FOO = "Hello World"
file { "/tmp/output":
ensure => present,
mode => 0600,
content => template('foo/test.erb'),
}
}
[root@centos5-64 foo]# cat templates/test.erb
<%= FOO %>
[root@centos5-64 foo]# puppet apply --verbose --modulepath=.. -e 'include
foo'
Failed to parse template foo/test.erb: uninitialized constant
Puppet::Parser::TemplateWrapper::FOO at /root/module/foo/manifests/init.pp:9 on
node centos5-64.localdomain
[root@centos5-64 foo]#
I'm not sure we should support this. my recommended fix would be to not allow
all cap variables in manifests.
----------------------------------------
Bug #3939: ALLCAPS variables arent usable in templates.
https://projects.puppetlabs.com/issues/3939
Author: R.I. Pienaar
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: parser
Target version:
Affected Puppet version: 2.7.9
Keywords:
Branch:
Puppet lets you set all caps variables in the manifest that you couldnt use in
a template:
<pre>
$FOO = "bar"
notice "from puppet: ${FOO}"
notice inline_template("<%= FOO %>")
</pre>
Output is:
<pre>
notice: Scope(Class[main]): from puppet: bar
Failed to parse inline template: uninitialized constant
Puppet::Parser::TemplateWrapper::FOO at /home/rip/test.pp:4 on node
nephilim.ml.org
</pre>
Not sure if you can make the template not handle those as constants, but if not
then the language shouldn't let us make all caps variables.
--
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.