Hello,

a related question here on this list sparked me to write this question,
which has been bugging me for a bit now:

I use the following pattern inside my modules quite abit:

class foo::params{

  $bar = $::foo_bar ? {
    '' => 'somedefaultvalue',
    default => $::foo_bar
  }
}

Then I can refer to the variable from my module by $foo::params::bar, which
is quite nice.

The problem is, I want to be able to set the value of $::foo_bar in a thrid
module in my services folder, but that is not possible because $::foo_bar
needs to be top-scope. I don't want to make module foo dirty by adding
$s_yadda::foo_bar but I don't see a better way, can anyone enlighten me as
to how they solve this problem? The only way I can think of is class
parameters, but that is a lot less clean.

I wish I could write to $::foo_bar from outside the top scope, even though
that is kind of dirty too :) .

cheers,

-- 
Walter Heck

--
follow @walterheck on twitter to see what I'm up to!
--
Check out my new startup: Server Monitoring as a Service @
http://tribily.com
Follow @tribily on Twitter and/or 'Like' our Facebook page at
http://www.facebook.com/tribily

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