Right now I'm referencing the variable as "<%= ldap_server %>" and puppet is complaining on startup about dynamic scoping and telling me this will break. So clearly this isn't the way to go otherwise I wouldn't have the warning.
On Tue, Jun 19, 2012 at 7:06 AM, earthgecko <garypwil...@gmail.com> wrote: > Due to the documentation not being specifically clear with regards to node > level variables and scoping. In 2.7 node variables they are local scope. > > Therefore in your templates you call the ldap_server variable NOT > ::ldap_server as it is not a top scope variable. > > As I say, the document is not specifically clear on how to qualify > variables in the node scope, but they appear to be in the local scope - > http://docs.puppetlabs.com/guides/scope_and_puppet.html > > If you use puppet-lint it will complain about the variables not being > qualified. Hopefully there will be some clarification on all the variable > and variable interpolation issues that 2.7 has highlighted, before the > release of 2.8/3.0 > > This is just what I have found that works. > > G > > > On Tuesday, June 19, 2012 4:05:26 AM UTC+1, Jon Schewe wrote: >> >> I saw a post a little while back about this, but didn't see the >> details of the solution. So I'm posting to see if someone can explain >> to me the correct way to do this in puppet 2.7+. >> >> I have a variable "ldap_server" that is used inside some templates. >> Some of my nodes use ldap1.company.com an some use ldap2.company.com. >> So in puppet 2.6 and earlier I have: >> >> node A { >> ldap_server = "ldap1.company.com" >> include ldap_config >> } >> >> node A { >> ldap_server = "ldap2.company.com" >> include ldap_config >> } >> >> I understand that in 2.7 this behavior is deprecated because of how >> variables are looked for and this behavior will stop working in 2.8. >> So what is the correct way to handle this in 2.7? >> >> Thank you. >> >> -- >> Jon Schewe | http://mtu.net/~jpschewe >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/rbL86S4ibI8J. > 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. > -- Jon Schewe | http://mtu.net/~jpschewe -- 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.