On Wednesday, August 8, 2012 12:49:57 AM UTC-5, Axel Bock wrote:
>
> Hi Oren, 
>
> I'm kind of new to puppet myself - but I think this is not working as you 
> might like. If you import a class with your definitions, your scope changes 
> AFAIK. So between
> import more_defs.qa
> and
> import more_defs.dev
> there is - again: AFAIK - one major disadvantage. Using classes you will 
> get different scopes for your variables - in the first case you'll get 
> more_defs.qa::myvar, and in the 2nd case more_defs.dev::myvar as 
> variable. probably no good.
>
>
I think you're confusing 'import' with 'include'.  It should be possible to 
put variable declarations at top-scope (outside any class or definition) in 
a manifest, and to 'import' that manifest at top scope to make them visible 
as global variables.  But that's ugly and brittle.  The 'import' function 
has very few good uses, and this is not one of them.

This sort of problem is hiera's bread and butter.  Although it is an 
extension to Puppet 2, hiera will be built into Puppet 3, so using it now 
is also forward-looking.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/0ICIVY5xCbkJ.
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