>From the snippet you posted, I don't see why you can't pass $var1 into the 
>define. No magic, just straightforward variable passing, right?

On Feb 11, 2013, at 9:31 AM, Roman Shaposhnik wrote:
> now that dynamic scope lookup is going away, I'm looking
> for a good alternative for the following use case: suppose
> I have a set of classes that all set up a pretty rich internal
> state with quite a few variables defined in their namespace.
> On top of that all of them need to do a common set of steps.
> 
> Previously I'd capture that set of steps into a custom define
> that would server a purpose of a macro:
> 
> define this_is_really_a_macro {
>  notify { "$var1 ... $varN": }
> }
> 
> and then 'expand' that macro inside of each of the classes
> 
>  class foo {
>      $var1 = ...
>      ....
>      this_is_really_a_macro { "macro 1": }
>  }
>  ....
> 
> Then, because of the dynamic scope lookup everything would
> work just fine.
> 
> Question: what's the recommended way of migrating to
> Puppet 3.X+ world here?
> 
> Thanks,
> Roman.
> 
> -- 
> 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 puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
Jo Rhett
Net Consonance : net philanthropy to improve open source and internet projects.



-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to