I have a variable initialized within a define but I cannot reference it 
from within a class.

contents of bar.pp:
define foo::bar (
  $my_var = 'this is my value',
){
  notice("The value in define: ${my_var}")
  include foo
}
contents of init.pp:
class foo{
  notice("The value in class: ${my_var}")
}

The problem is that the value of my_var within the class is empty.

For instance if do:
class myclass(){
  foo::bar{}
}
I see:
The value in define: this is my value
The value in class:

How can a variable that is defined in a "define" be accessible from within 
a class?

thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d47b3812-318e-46cc-addc-bd349e39a31a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to