On 6/7/12 10:14 AM, [email protected] wrote:
> I am using puppet 2.7.14
>
> I have a class that I use just to define a bunch of variables used by my
> module, several of them used in more than once place.
>
> Currently I have it in module/manifests/classes/module_vars.pp
>
> In some of the other classes, I was able to use the variables by
> qualifying the name - module::module_vars::var
>
> However, I am having trouble getting these variables to show up in my
> templates.
>
> First I just tried using the plain name, then I tried using
> |
> ||scope.lookupvar(module_vars::var)|
> |scope.lookupvar(module::module_vars::var)
>
> but all that shows up in my template is "undefined".
>
> I've looked through the documentation, but I can't figure out what I am
> doing wrong.
>
> Thank you.
One method would be to bring them into the local scope.
class foo {
$var = $variables::var
}
then in your template you could use
<%= var %>
Two issues I spotted though. Your path setup is not correct for the
auto-loader. Suggested reading -
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
Also, check out Hiera -
http://puppetlabs.com/blog/first-look-installing-and-using-hiera/
-g
--
Garrett Honeycutt
206.414.8658
http://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.