Paul wrote:
>> See http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#quoting
> Indeed, shame on me ;)  But if you take that literally brackets
> shouldn't be needed.

Except that the underscore is a valid part of a variable name and puppet 
does longest match on variable names, thus recognising $name_production, 
instead of the existing $name.


>>> Apparently there seem to be more differences between classes and
>>> defines wrt. scope. When I use template("foo.erb") inside a define() I
>>> don't have direct access to facts or other variables (fex. the $name).
>>> However scope.lookupvar('name') works. Is this expected behaviour?
>> No. What version of puppet are you using? How did your ERB look like?
> Version is 0.24.8, I'm testing with:
> -------------------------
> <% tags.each do |tag| -%>
>     TAG: <%= tag %>
> <% end -%>
> SCOPE LOOKUP <%= scope.lookupvar('name') %>
> SCOPE LOOKUP <%= scope.lookupvar('ipaddress_eth0') %>
> <VirtualHost <%= $ipaddress_eth0 %>:80>

Stuff within <%%> is ruby. Ruby has no $ sigils. Use the variable 
instead without the dollar sign:

 > <VirtualHost <%= ipaddress_eth0 %>:80>


Regards, DavidS

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to