Ah, yes, in this case putting it in a class wouldn't work.  Well, obviously it 
wouldn't apply to all variables but in case of paths what I often to is split 
it, e.g. have $log_root = "/var/log" in the class and in the define do 
${class::log_root}/${site}.

On Thursday 25 Mar 2010 13:42:13 Gustavo Soares wrote:
> Hi, Michael, thank you for your reply.
> 
> What I mean about "dynamic variables" is:
> 
> let's say that I have a variable like *$log_path = "/var/log/$site"  *to
> specify the log path for different applications
> that run on the same host.  Thus, depending on the value of $site
> variable, the $log_path variable will be different.
> 
> If I put that in a class, it will be evaluated for the first value of $site
> called, right? or am I missing something?
> 
> I hope, that I could clarify. :)
> 
> Gus
> 
> On Thu, Mar 25, 2010 at 9:54 AM, Michael Gliwinski <
> 
> michael.gliwin...@henderson-group.com> wrote:
> > On Thursday 25 Mar 2010 11:48:44 Gustavo Soares wrote:
> > > I have thought of using qualified variables, but i think that won't
> > > work inside a tempalte, right? Or can I do <%= class::variable %> ?
> >
> > It will but you have to use <%= scope.lookup('class::variable') %> (note,
> > typing from memory, to be sure check the puppet templating page on the
> > wiki,
> > there is an example there).
> >
> > > And I guess that if I am using dynamic variables, once I include the it
> > > will be evaluated only once, right?
> >
> > I'm not sure what you mean by dynamic variables, but the class is indeed
> > evaluated only once (and therefore variables are bound only once IIUC),
> > even
> > though it is included from a define which may be declared (i.e.
> > 'called'?) multiple times.
> >
> >
> > --
> > Michael Gliwinski
> > Henderson Group Information Services
> > 9-11 Hightown Avenue, Newtownabby, BT36 4RT
> > Phone: 028 9034 3319
> >
> >
> > *************************************************************************
> >********************* The information in this email is confidential and
> > may be legally privileged.  It is intended solely for the addressee and
> > access to the email by anyone else is unauthorised.
> > If you are not the intended recipient, any disclosure, copying,
> > distribution or any action taken or omitted to be taken in reliance on
> > it, is prohibited and may be unlawful.
> > When addressed to our clients, any opinions or advice contained in this
> > e-mail are subject to the terms and conditions expressed  in the
> > governing client engagement leter or contract.
> > If you have received this email in error please notify
> > supp...@henderson-group.com
> >
> > John Henderson (Holdings) Ltd
> > Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern
> > Ireland, BT36 4RT.
> > Registered in Northern Ireland
> > Registration Number NI010588
> > Vat No.: 814 6399 12
> >
> > *************************************************************************
> >********
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@goog
> >legroups.com> .
> > For more options, visit this group at
> > http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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