Dan Urist
2010-Sep-02 19:40 UTC
[Puppet Users] variable set in site.pp not visible in nodes.pp
I have another glitch with 2.6.1-rc2 that worked in 0.25-- I set a global variable in my site.pp that is used in my nodes.pp, but it''s no longer set there, though it still is in my modules. Is this a bug, or a design change? -- Dan Urist durist@ucar.edu 303-497-2459 -- 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.
Peter Meier
2010-Sep-02 21:32 UTC
Re: [Puppet Users] variable set in site.pp not visible in nodes.pp
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> I have another glitch with 2.6.1-rc2 that worked in 0.25-- I set a > global variable in my site.pp that is used in my nodes.pp, but it''s no > longer set there, though it still is in my modules. Is this a bug, or a > design change?I have a similar setup that works. But do you set it before or after you import nodes.pp? And do you have a minimal setup that reproduces that? cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyAF/sACgkQbwltcAfKi3+2iQCeMjnZYjH45DdXmK0jnpVJ28/m IM0An0XiFPr2B0Yj82EEvRlbDhw+/Ne3 =+Gfw -----END PGP SIGNATURE----- -- 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.
Dan Urist
2010-Sep-03 15:17 UTC
Re: [Puppet Users] variable set in site.pp not visible in nodes.pp
On Thu, 02 Sep 2010 23:32:43 +0200 Peter Meier <peter.meier@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > >> I have another glitch with 2.6.1-rc2 that worked in 0.25-- I set a >> global variable in my site.pp that is used in my nodes.pp, but it''s >>no >> longer set there, though it still is in my modules. Is this a bug, >>or a >> design change? > > I have a similar setup that works. But do you set it before or after >you > import nodes.pp? > And do you have a minimal setup that reproduces that?I''ve done a little bit more digging, and it looks like the variable is set within a node definition, but not outside it. site.pp:> $testvar = "TESTVAR_VALUE" > import "nodes"nodes.pp:> notice("testvar outside node is: ${testvar}") > node ''test.puppet.cms.ucar.edu'' { > notice("testvar inside node is: ${testvar}") > }In my logs, I get:> puppet-master[3757]: (Scope(Class[main])) testvar outside node is: > puppet-master[3757]: (Scope(Node[test.puppet.cms.ucar.edu])) testvarinside node is: TESTVAR_VALUE If I then attempt to assign the variable in nodes.pp, but outside of the node definition, I get an error: nodes.pp:> $testvar = "TESTVAR_SET_IN_NODES" > notice("testvar outside node is: ${testvar}") > node ''test.puppet.cms.ucar.edu'' { > notice("testvar inside node is: ${testvar}") > }Here''s the error log entry:> puppet-master[3754]: (Scope(Class[main])) testvar outside node is:TESTVAR_SET_IN_NODES> puppet-master[3754]: Cannot reassign variable testvar at/usr/local/puppet/dev/site.pp:18 on node test.puppet.cms.ucar.edu> puppet-master[3754]: Cannot reassign variable testvar at/usr/local/puppet/dev/site.pp:18 on node test.puppet.cms.ucar.edu So it looks like there are two different scopes now? In 0.25, I was setting the variable outside of the node definition; I was using this to set some path variables. Is this a bug, or was this change intended? -- 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.
Peter Meier
2010-Sep-03 15:39 UTC
Re: [Puppet Users] variable set in site.pp not visible in nodes.pp
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> So it looks like there are two different scopes now? In 0.25, I was > setting the variable outside of the node definition; I was using > this to set some path variables. Is this a bug, or was this change > intended?Hmm the only difference to how I use such variables is that I have everything within the site.pp, so the variable declaration and the nodes. Can you try if that works? What I could imagine is that imports are now evaluated before variables. But if this is a behavior change between 0.25 and 2.6 you should file a bug report. at least it should be document. pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyBFsAACgkQbwltcAfKi38lzQCgk/xA5/T1StKbFLsfCrpx9BHf 8pMAnjSmhK9dOxS6RtocGx4ZasqRRdvg =PEQ3 -----END PGP SIGNATURE----- -- 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.
Dan Urist
2010-Sep-03 19:11 UTC
Re: [Puppet Users] variable set in site.pp not visible in nodes.pp
On Fri, 03 Sep 2010 17:39:46 +0200 Peter Meier <peter.meier@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > So it looks like there are two different scopes now? In 0.25, I was > > setting the variable outside of the node definition; I was using > > this to set some path variables. Is this a bug, or was this change > > intended? > > Hmm the only difference to how I use such variables is that I have > everything within the site.pp, so the variable declaration and the > nodes. > > Can you try if that works?That does indeed work.> What I could imagine is that imports are now evaluated before > variables. But if this is a behavior change between 0.25 and 2.6 you > should file a bug report. at least it should be document. >That seems like a pretty major change in behavior to me... global variables are no longer really global? Anyway, I''ve filed a bug: http://projects.reductivelabs.com/issues/4717 Thanks for your help. -- Dan Urist durist@ucar.edu 303-497-2459 -- 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.