John Sellens
unread,Dec 15, 2014, 12:07:45 PM12/15/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
I couldn't find any reference to this different behaviour, so I'm
wondering if anyone knows if this is intentional.
I use a bunch of defined types, and with the future parser, when I refer
to a variable in a template, it seems that the default scope is not the
scope of the class.
e.g. in a template, <%= @a %> no longer refers to $a from the current
class.
This is different behaviour than with the current parser, and doesn't
seem to match the documentation I've found, or the behaviour with the
standard types.
For example, I have a module called "parsetest" and the init.pp is:
define fileerb ( ) {
file { "/tmp/$name":
content => template( "parsetest/${name}.erb" ),
}
}
class parsetest {
$a = "hello"
fileerb { "bloop" : }
}
The templates/bloop.erb contains:
the value of a is: <%= @a %>
In current puppet, the value of $a ends up in /tmp/bloop.
With the future parser, no value is used, and I don't see
any errors.
I see this in puppet 3.7.3 (from the puppetlabs yum repo) and
also in 3.6.2 (from freebsd ports).
Is it expected that a defined type evaluates templates in a
(seemingly) different scope?
Thanks for any insight!
John