Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Michael Gliwinski
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 Gustav

Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Gustavo Soares
well, forget what I said.. It seems that I have misunderstood the variable scope... I will try to do as you suggest. Thanks! On Thu, Mar 25, 2010 at 10:42 AM, Gustavo Soares wrote: > Hi, Michael, thank you for your reply. > > What I mean about "dynamic variables" is: > > let's say that I have

Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Gustavo Soares
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 varia

Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Michael Gliwinski
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 su

Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Gustavo Soares
I have thought of using qualified variables, but i think that won't work inside a tempalte, right? Or can I do <%= class::variable %> ? And I guess that if I am using dynamic variables, once I include the it will be evaluated only once, right? Gus --- Original message --- From: Michael

Re: [Puppet Users] sharing variables between definitions

2010-03-25 Thread Michael Gliwinski
On Wednesday 24 Mar 2010 22:15:27 Michael DeHaan wrote: > On Wed, Mar 24, 2010 at 5:51 PM, Gustavo Soares wrote: > > Hi, Michael! thanks for your reply! > > > > actually it is the opposite.. :) i.e, I want to use the same variable, > > but in different definitions... > > Ok, sorry for the confusi

Re: [Puppet Users] sharing variables between definitions

2010-03-24 Thread Michael DeHaan
On Wed, Mar 24, 2010 at 5:51 PM, Gustavo Soares wrote: > Hi, Michael! thanks for your reply! > > actually it is the opposite.. :) i.e, I want to use the same variable, but > in different definitions... > Ok, sorry for the confusion. I would have thought "$common_variables::x" would have worked

Re: [Puppet Users] sharing variables between definitions

2010-03-24 Thread Gustavo Soares
Hi, Michael! thanks for your reply! actually it is the opposite.. :) i.e, I want to use the same variable, but in different definitions... Using classes, I can accomplish that using class inheritance, but with definitions.. I have no clue... Just to clarify the reason of that... 1) I have a cou

Re: [Puppet Users] sharing variables between definitions

2010-03-24 Thread Michael DeHaan
On Wed, Mar 24, 2010 at 5:11 PM, Michael DeHaan wrote: > > On Wed, Mar 24, 2010 at 3:10 PM, Gustavo Soares > wrote: > >> Hi everybody! >> >> I would like to share a group of variables between definitions and I don't >> know what it is the best approach to do this... >> >> First, let me explain th

Re: [Puppet Users] sharing variables between definitions

2010-03-24 Thread Michael DeHaan
On Wed, Mar 24, 2010 at 3:10 PM, Gustavo Soares wrote: > Hi everybody! > > I would like to share a group of variables between definitions and I don't > know what it is the best approach to do this... > > First, let me explain the situation... > > I were using a class and defining those variables