On Tue, Jul 6, 2010 at 11:52 AM, Jeff <[email protected]> wrote:
> Hello puppeteers,
>
> We are in the process of upgrading to 0.25.4 and I've discovered an
> issue. I have a global class called global that looks like this:
>
> class globals {
>
>  $java          = "/usr/bin/java"
>  $javac         = "/usr/bin/javac"
>  $java_home     = "/usr/java/jdk1.5.0_15"
>  $dynamo_home   = "/usr/local/ATG/ATG2007.1/home"
>  $jboss_home    = "/usr/local/jboss"
>  $jboss_release = "4.0.5.GA"
>  $atg_release   = "2007.1"
>  $ant_home      = "/opt/apache-ant-1.7.1"
> }
>
>
> If I include it in a node and try to access $java_home, I get no
> value:
>
> node 'homer.simpson.com' {
>  include globals
>  notify { "globalchk" : message => "Here's my java_home:
> ($java_home)" }
> }

Those variables are actually being declared in the scope of the
namespace named "globals" rather than in top scope.

In order to reference them, you could use $::globals::java_home or
"${::globals::java_home}"

Check out the sections on variables and scope in the language tutorial:
http://docs.reductivelabs.com/guides/language_tutorial.html

Hope this helps,
-- 
Jeff McCune
http://www.puppetlabs.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

Reply via email to