Hi all,
Recently, when playing with a small puppet environment with modules,
I''ve
discovered the following behavior.
when entering variables in site.pp file (not under any node / class scope)
they will not be valid in any class which is inside a module.
when using import from the same site.pp with the exact same lines (not
inside a node or a class definition) it works.
for example:
#not working
site.pp
$var=''boo''
in a module
class module::class {
use $var here
}
however the same works if you just do:
site.pp
import site2.pp
..
..
site2.pp
$var=''boo''
..
..
Cheers,
Ohad
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
I use the first form all the time. I think there must be something else going on here for you. -Paul On 7/27/08, Ohad Levy <ohadlevy@gmail.com> wrote:> Hi all, > > Recently, when playing with a small puppet environment with modules, I''ve > discovered the following behavior. > > when entering variables in site.pp file (not under any node / class scope) > they will not be valid in any class which is inside a module. > when using import from the same site.pp with the exact same lines (not > inside a node or a class definition) it works. > > for example: > > #not working > site.pp > > $var=''boo'' > > in a module > > class module::class { > use $var here > } > > however the same works if you just do: > > site.pp > import site2.pp > .. > .. > site2.pp > $var=''boo'' > .. > .. > > > Cheers, > Ohad > > > >-- Sent from Gmail for mobile | mobile.google.com --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, Jul 27, 2008 at 10:51 PM, Ohad Levy <ohadlevy@gmail.com> wrote:> yes, you are right, I forgot to mention that I use it inside a template. > > Ohad > > On Mon, Jul 28, 2008 at 11:20 AM, Paul Lathrop <paul@tertiusfamily.net> > wrote: >> >> I use the first form all the time. I think there must be something >> else going on here for you. >> >> -Paul >>I have noticed this to. the solution I found was to reasisin the variables in the module init.pp then they get picked up by the templates. class module::class { $boo=$boo use $var here } Evan --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
So is it safe to assume its a bug? Thanks, Ohad On Mon, Jul 28, 2008 at 9:07 PM, Evan Hisey <ehisey@gmail.com> wrote:> > On Sun, Jul 27, 2008 at 10:51 PM, Ohad Levy <ohadlevy@gmail.com> wrote: > > yes, you are right, I forgot to mention that I use it inside a template. > > > > Ohad > > > > On Mon, Jul 28, 2008 at 11:20 AM, Paul Lathrop <paul@tertiusfamily.net> > > wrote: > >> > >> I use the first form all the time. I think there must be something > >> else going on here for you. > >> > >> -Paul > >> > I have noticed this to. the solution I found was to reasisin the > variables in the module init.pp then they get picked up by the > templates. > > class module::class { > $boo=$boo > use $var here > } > > Evan > > > >--~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, Jul 28, 2008 at 8:26 AM, Ohad Levy <ohadlevy@gmail.com> wrote:> So is it safe to assume its a bug? > > Thanks, > Ohad >or a feature, James or Luke will have to weigh in that decision. Evan --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 27, 2008, at 7:17 PM, Ohad Levy wrote:> Hi all, > > Recently, when playing with a small puppet environment with > modules, I''ve discovered the following behavior. > > when entering variables in site.pp file (not under any node / class > scope) they will not be valid in any class which is inside a module. > when using import from the same site.pp with the exact same lines > (not inside a node or a class definition) it works. > > for example: > > #not working > site.pp > > $var=''boo'' > > in a module > > class module::class { > use $var here > } > > however the same works if you just do: > > site.pp > import site2.pp > .. > .. > site2.pp > $var=''boo'' > .. > ..I don''t really understand what you''re describing here -- can you provide more fleshed-out examples? I''ll certainly agree that there are weirdnesses related to how variables are handled. -- Discovery consists of seeing what everybody has seen and thinking what nobody has thought. -- Albert Szent-Gyorgyi --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---