I''m on 2.6.4, and I have one template that just won''t work. I want to only print a section when a variable has a particular value. Depending on hostname, a variable called "dns_role" has the value of either "master" or "slave". This template snippet works for a named.conf file template (not part of the problem): <% if has_variable?("dns_role") && dns_role != '''' then %> include "/etc/zones_<%= dns_role %>.conf"; <% end %> The named.conf file has either "master" or "slave" inserted, and the proper BIND config file is there from another process. Now - the problem - is that this snippet doesn''t ever print anything (for a shell script that actually generates the zone files and named.conf files): <% if dns_role == "master" then %> # # I''m a BIND <%= dns_role %> # cp -f $startdir/zones/* /var/named/internal/ <% end %> I''ve tried it like this: <% if has_variable?("dns_role") && if dns_role == "master" then %> cp -f $startdir/zones/* /var/named/internal/ <% end %> ...and even like this: <% if has_variable?("dns_role") then %> <% if dns_role == "master" then %> cp -f $startdir/zones/* /var/named/internal/ <% end %> <% end %> All I want is for this shell script line included only when it''s a master DNS server. I''d hate to result to setting a variable to either have a hash sign or not depending on role and just use puppet templates to comment out the line. That''s pretty ugly, when I can do the if/then using Ruby. Any thoughts? I''m stuck. Thanks. -- twitter: @procnetdev -- 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.
> <% if has_variable?("dns_role") then %> > <% if dns_role == "master" then %> > cp -f $startdir/zones/* /var/named/internal/ > <% end %> > <% end %>I''m certainly no ERB expert but my first thought is that your shell command is not being seen as a system call during the template processing. I would think you''d need the copy line to be enclosed in <% %>. This example template creates the file /var/tmp/test-$hostname when the template is parsed <% system("/usr/bin/touch /var/tmp/test-#{hostname}") %> Could that what your running into? HTH. deet. -- 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.
Thanks a lot for the reply, deet. I don''t want it executed on the puppet server - this is part of a larger shell script being sent to a client, that is then run periodically from cron. I simply want this single line of shell included *only* when the host is a master DNS server, i.e. $dns_role == "master". Does that explain it better? Thanks again. On Thu, Dec 23, 2010 at 2:42 PM, deet <someword@gmail.com> wrote:> >> <% if has_variable?("dns_role") then %> >> <% if dns_role == "master" then %> >> cp -f $startdir/zones/* /var/named/internal/ >> <% end %> >> <% end %> > > I''m certainly no ERB expert but my first thought is that your shell > command is not being seen as a system call during the template > processing. > > I would think you''d need the copy line to be enclosed in <% %>. > This example template creates the file /var/tmp/test-$hostname when > the template is parsed > > <% system("/usr/bin/touch /var/tmp/test-#{hostname}") %> > > Could that what your running into? > HTH. deet. > > -- > 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. > >-- twitter: @procnetdev -- 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 Thu, Dec 23, 2010 at 10:30:22AM -0800, Me wrote:> I''m on 2.6.4, and I have one template that just won''t work. I want to > only print a section when a variable has a particular value. Depending > on hostname, a variable called "dns_role" has the value of either > "master" or "slave". > > This template snippet works for a named.conf file template (not part > of the problem): > > <% if has_variable?("dns_role") && dns_role != '''' then %> > include "/etc/zones_<%= dns_role %>.conf"; > <% end %> > > The named.conf file has either "master" or "slave" inserted, and the > proper BIND config file is there from another process. > > Now - the problem - is that this snippet doesn''t ever print anything > (for a shell script that actually generates the zone files and > named.conf files): > > <% if dns_role == "master" then %> > # > # I''m a BIND <%= dns_role %> > # > cp -f $startdir/zones/* /var/named/internal/ > <% end %> >My first idea was the usage of "then" because I''d only ever see ruby statements like if a==b do_something end But I just tried it and it did worked. Then just another comment: If you use <%if ... -%> and <% end -%> than these statements will not produce blank lines in your final file... To your actual problem: What happens if you just put a <%= dns_role %> in front of your if-statement. Are you sure dns_role is actual set to the correct value (no hidden blanks or anything)? If dns_role is correctly set but your if-statement is still not evaluated try with dns_role.to_s to make sure its a string. Or maybe there is syntax error, missing bracket or whatever in your template (or node manifest that mixes up scope) -Stefan
On Thu, Dec 23, 2010 at 3:34 PM, Stefan Schulte <stefan.schulte@taunusstein.net> wrote:> On Thu, Dec 23, 2010 at 10:30:22AM -0800, Me wrote: >> >> <% if dns_role == "master" then %> >> # >> # I''m a BIND <%= dns_role %> >> # >> cp -f $startdir/zones/* /var/named/internal/ >> <% end %>SNIP> > To your actual problem: What happens if you just put a <%= dns_role %> > in front of your if-statement. Are you sure dns_role is actual set to the > correct value (no hidden blanks or anything)? If dns_role is correctly > set but your if-statement is still not evaluated try with dns_role.to_s > to make sure its a string. Or maybe there is syntax error, missing > bracket or whatever in your template (or node manifest that mixes up > scope) > > -StefanThat''s why I put the example in where it has "# I''m a BIND <%dns_role %>" - it does indeed print out "master" without any blanks or anything. It just plain doesn''t work, when it seems it should. I ended up just printing it out into the shell script and having the shell compare what''s substituted with the string "master" - and of course it works. I''ve worked around the problem. There''s no scoping issue - just seems that Puppet is buggy. Thanks for your help, I don''t think there''s a fix. -- twitter: @procnetdev -- 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 Fri, Dec 24, 2010 at 10:49, Me <infosec@gmail.com> wrote:> On Thu, Dec 23, 2010 at 3:34 PM, Stefan Schulte > <stefan.schulte@taunusstein.net> wrote: >> On Thu, Dec 23, 2010 at 10:30:22AM -0800, Me wrote: >>> >>> <% if dns_role == "master" then %> >>> # >>> # I''m a BIND <%= dns_role %> >>> # >>> cp -f $startdir/zones/* /var/named/internal/ >>> <% end %>[...]> There''s no scoping issue - just seems that Puppet is buggy. Thanks for > your help, I don''t think there''s a fix.I have a bunch of manifests and templates that do similar things, and we never had any problems with them *except* for things like ''fork'' that are in the Ruby ''kernel'' module. (Which is a Ruby / ERB issue, more or less.) Can you post a minimal set of files to verify this? If it is a puppet bug we would definitely want to fix it, and having the minimal manifest and template that demonstrate it mean we can make sure it *stays* fixed. Thanks, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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 Thu, Dec 23, 2010 at 03:49:34PM -0800, Me wrote:> On Thu, Dec 23, 2010 at 3:34 PM, Stefan Schulte > <stefan.schulte@taunusstein.net> wrote: > > On Thu, Dec 23, 2010 at 10:30:22AM -0800, Me wrote: > >> > >> <% if dns_role == "master" then %> > >> # > >> # I''m a BIND <%= dns_role %> > >> # > >> cp -f $startdir/zones/* /var/named/internal/ > >> <% end %> > SNIP > > > > To your actual problem: What happens if you just put a <%= dns_role %> > > in front of your if-statement. Are you sure dns_role is actual set to the > > correct value (no hidden blanks or anything)? If dns_role is correctly > > set but your if-statement is still not evaluated try with dns_role.to_s > > to make sure its a string. Or maybe there is syntax error, missing > > bracket or whatever in your template (or node manifest that mixes up > > scope) > > > > -Stefan > > > That''s why I put the example in where it has "# I''m a BIND <%> dns_role %>" - it does indeed print out "master" without any blanks or > anything. > > It just plain doesn''t work, when it seems it should. I ended up just > printing it out into the shell script and having the shell compare > what''s substituted with the string "master" - and of course it works. > I''ve worked around the problem.I don''t really get it. You''re testing dns_role agains "master". And you can see that dns_role is indeed "master" when you just use some simple <%= dns_role %>. And the code inside your if statement is evaluated. So what exactly is the problem? Or is your problem that even nodes that dont have dns_role set are including this cp command? And dns_role is still "master" when you never set it to "master"? Or do you see the comments but no cp command? I just put your snippet in a template and it works as expected. -Stefan
On Thu, Dec 23, 2010 at 4:19 PM, Stefan Schulte <stefan.schulte@taunusstein.net> wrote:> I don''t really get it. You''re testing dns_role agains "master". And you > can see that dns_role is indeed "master" when you just use some simple > <%= dns_role %>. And the code inside your if statement is evaluated. So > what exactly is the problem? Or is your problem that even nodes that > dont have dns_role set are including this cp command? And dns_role is > still "master" when you never set it to "master"? > > Or do you see the comments but no cp command? I just put your snippet in > a template and it works as expected. >The cp command is never included in the templatized shell script, no comments either, whether "dns_role" is set to "master" or "slave". That''s why I called it a bug, since it makes no sense. I even have super experienced programmers that do Puppet day in and out at work, and they just scratched their heads. -- twitter: @procnetdev -- 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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 My guess is that ''=='' is actually comparing objects in Ruby. Try dns_role.eql?("stuff") and see if you get a better result. Trevor On 12/23/2010 09:10 PM, Me wrote:> On Thu, Dec 23, 2010 at 4:19 PM, Stefan Schulte > <stefan.schulte@taunusstein.net> wrote: >> I don''t really get it. You''re testing dns_role agains "master". And you >> can see that dns_role is indeed "master" when you just use some simple >> <%= dns_role %>. And the code inside your if statement is evaluated. So >> what exactly is the problem? Or is your problem that even nodes that >> dont have dns_role set are including this cp command? And dns_role is >> still "master" when you never set it to "master"? >> >> Or do you see the comments but no cp command? I just put your snippet in >> a template and it works as expected. >> > > The cp command is never included in the templatized shell script, no > comments either, whether "dns_role" is set to "master" or "slave". > > That''s why I called it a bug, since it makes no sense. I even have > super experienced programmers that do Puppet day in and out at work, > and they just scratched their heads.- -- Trevor Vaughan Vice President, Onyx Point, Inc. email: tvaughan@onyxpoint.com phone: 410-541-ONYX (6699) pgp: 0x6C701E94 - -- This account not approved for unencrypted sensitive information -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJNFAIwAAoJECNCGV1OLcypu1wIAJzLUmEB95wGSoostLKAfFI3 1z3/aGLA0g4sjvxF/7plCaJFpQcyQvEEtyeS2YtSQXiTkV6UAWIqRmLb1dijpHiE rL7iufpfFFIIy1gmayntMHKTmRGUiFkFUunJFX4seCJRhchPmDwexJFQ7iubOp2G s+oHx8YLmw5zK5e9U1fZzMceD3YOusx5fxBO8vxKx7qYNhEWX38hKekc8+0saKg3 4zLZz9TQ2kwywoAM5blHV3iKKkHPB8IwPiomCVWJz7eZfi9e1otdZsDHEV9i4B+C xiYkTe2UoO3a7WjTe//vxILxR7QtKgT3zgwt1GDjMZTN00wJ32q4PQyK0P374kk=0lT9 -----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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Also, did you stub out your template and run it manually with erb? <% # This stuff is stubs for variables that would normally be passed in # by a define. var1 = ''foo'' var2 = ''bar'' - -%> <% # Begin normal template if var1.eql?(''foo'') then - -%> <%= var2 %> <% end -%> Then run that file with ''erb -T- <filename>'' and see what happens. Trevor On 12/23/2010 09:10 PM, Me wrote:> On Thu, Dec 23, 2010 at 4:19 PM, Stefan Schulte > <stefan.schulte@taunusstein.net> wrote: >> I don''t really get it. You''re testing dns_role agains "master". And you >> can see that dns_role is indeed "master" when you just use some simple >> <%= dns_role %>. And the code inside your if statement is evaluated. So >> what exactly is the problem? Or is your problem that even nodes that >> dont have dns_role set are including this cp command? And dns_role is >> still "master" when you never set it to "master"? >> >> Or do you see the comments but no cp command? I just put your snippet in >> a template and it works as expected. >> > > The cp command is never included in the templatized shell script, no > comments either, whether "dns_role" is set to "master" or "slave". > > That''s why I called it a bug, since it makes no sense. I even have > super experienced programmers that do Puppet day in and out at work, > and they just scratched their heads.- -- Trevor Vaughan Vice President, Onyx Point, Inc. email: tvaughan@onyxpoint.com phone: 410-541-ONYX (6699) pgp: 0x6C701E94 - -- This account not approved for unencrypted sensitive information -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJNFAKiAAoJECNCGV1OLcypzesH/jMUcHl+Y6KoNY1327WjSPfz Oa7zGdBlvirwAXsYXXbm3240J5XRVgaG5nMvKjIuism+3Ve4OV2x2zlajV+sSuOw yQeYEo3APkO1I7TrjHuVW+ZSaU2GdO0KBLCc061SxlUKrcaOwJwk0e9a/6MTqlsr BTWBnDE+zmbB0lmJ/nubXkwBdY6VMSd/4U9QwjrKuGudEb053ny614unZJgQRYzi ABKBSPrbGQSPfzxtN34aKI9qV0HkjN1zb3vdOHby8LQ+JMTbJ6uvpToX/rQCC6pf VOGf1bfytCGLCwJ3Eh4K/fhMqveVRAaGT0xCm9JL07sby1riCsXzro0VJQNAz0Y=13jC -----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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Meh, ignore this post, I had my statement backward. == should work where .eql doesn''t. Trevor On 12/23/2010 09:15 PM, Trevor Vaughan wrote:> My guess is that ''=='' is actually comparing objects in Ruby. > > Try dns_role.eql?("stuff") and see if you get a better result. > > Trevor > > On 12/23/2010 09:10 PM, Me wrote: >> On Thu, Dec 23, 2010 at 4:19 PM, Stefan Schulte >> <stefan.schulte@taunusstein.net> wrote: >>> I don''t really get it. You''re testing dns_role agains "master". And you >>> can see that dns_role is indeed "master" when you just use some simple >>> <%= dns_role %>. And the code inside your if statement is evaluated. So >>> what exactly is the problem? Or is your problem that even nodes that >>> dont have dns_role set are including this cp command? And dns_role is >>> still "master" when you never set it to "master"? >>> >>> Or do you see the comments but no cp command? I just put your snippet in >>> a template and it works as expected. >>> > >> The cp command is never included in the templatized shell script, no >> comments either, whether "dns_role" is set to "master" or "slave". > >> That''s why I called it a bug, since it makes no sense. I even have >> super experienced programmers that do Puppet day in and out at work, >> and they just scratched their heads. >- -- Trevor Vaughan Vice President, Onyx Point, Inc. email: tvaughan@onyxpoint.com phone: 410-541-ONYX (6699) pgp: 0x6C701E94 - -- This account not approved for unencrypted sensitive information -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJNFAL7AAoJECNCGV1OLcypBccIAIetMWvFefq6XVVt6sZO0wEA e2KjuDGw34ivOJySOzu57KRx+UGKD9PXtA+jkUthFeJzyFe4nAogpZF2G1RoAgEK 6Tf4pi/QjbJrbeoBUBKs8+CbGVmTZQJNEs+rEG0wk2Vm/QqlMGRpXIt1IYxd7UK2 9+rB3RZrh84VVHXo1pIAF73ZXBrXssifBjEW4YkGRb2NWF5CeFEtxpxwwyJ02W1q VNYjNoCnWpI1+VMd6EX6mEFemhT2cQ58cHCmqppq/KJR3xDEpc96iduAKxhBKCxw Tgf1zTCLRhzllFMk2ZPPq+FW58yfYY32GXh5bF9LU5Y/2IhDJDCl4WD2LunkzYg=jW0o -----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.
On Thu, Dec 23, 2010 at 6:15 PM, Trevor Vaughan <tvaughan@onyxpoint.com> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > My guess is that ''=='' is actually comparing objects in Ruby. > > Try dns_role.eql?("stuff") and see if you get a better result. >I love how helpful you guys are. ;) I tried that, it still didn''t print. I even did dns_role.grep and no love. That''s when I gave up and expanded the variable in the template (which is a shell script) and just compared with this: <% if has_variable?("dns_role") then -%> cp -f $startdir/namedconf/zones_<%= dns_role %>.conf /etc # # I''m a BIND <%= dns_role %> # # The LHS is filled in via a Puppet template, it always knows if we''re a master or slave. # No matter what I tried, the puppet template could never figure out if the "dns_role" # variable contained "master" or "slave" - so we''ll let the shell figure it out # if [ "<%= dns_role %>" == master ] then cp -f $startdir/zones/* /var/named/internal/ fi <% end -%> ...which turns into this: cp -f $startdir/namedconf/zones_master.conf /etc # # I''m a BIND master # # The LHS is filled in via a Puppet template, it always knows if we''re a master or slave. # No matter what I tried, the puppet template could never figure out if the "dns_role" # variable contained "master" or "slave" - so we''ll let the shell figure it out # if [ "master" == master ] then cp -f $startdir/zones/* /var/named/internal/ fi ...so it works. I just can''t make Ruby do the compare for me, when I put it in the if clause, it never wants to match. So you can see from the shell script what I want my template logic to be - I wanted Puppet to decide when that line should be in the shell script. It''s fine as-is, but it would be nice to know either a) what I was doing wrong or b) if Puppet has a bug to fix. I''m replying now to an earlier message that asked for the configs. Maybe they''ll clear things up... -- 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 Thu, Dec 23, 2010 at 4:10 PM, Daniel Pittman <daniel@rimspace.net> wrote:> On Fri, Dec 24, 2010 at 10:49, Me <infosec@gmail.com> wrote: > >> There''s no scoping issue - just seems that Puppet is buggy. Thanks for >> your help, I don''t think there''s a fix. > > I have a bunch of manifests and templates that do similar things, and > we never had any problems with them *except* for things like ''fork'' > that are in the Ruby ''kernel'' module. (Which is a Ruby / ERB issue, > more or less.) > > Can you post a minimal set of files to verify this? If it is a puppet > bug we would definitely want to fix it, and having the minimal > manifest and template that demonstrate it mean we can make sure it > *stays* fixed.Ok, going back in SVN history... The nodes file: node /dns[0-9]+/ inherits globals { $dns_role = $hostname ? { # needs to be either "master" or "slave" /dns01/ => [ "master" ], # the 01 box is always the master by convention default => [ "slave" ], } include "defaults" include "host2dns" } The hosts2dns class has this in part of a file section: "${basedir}/scripts/host2dns.sh": owner => "0", group => "0", mode => "0550", ensure => present, content => template("OBFUSCATED/host2dns/host2dns.sh.erb"); ...and the template: # # This line generated by Puppet based on config variables. # Only copy zone files into place if we''re a master. # <% if has_variable?("dns_role") && dns_role == "master" then %> cp -f $startdir/zones/* /var/named/internal/ <% end %> rndc reconfig -noexpired rndc reload ...everything else in it is straight shell. So with this template - the line with "cp" in it is *never* included in the generated file on both the master and slave boxes. It just never works. So by comparison, the same "host2dns" class has this in the files section: "/etc/named.conf": owner => "0", group => "0", mode => "0444", ensure => present, content => template("OBFUSCATED/host2dns/named.conf.erb"); ...and these template contents in named.conf.erb: // this line generated by Puppet based on config variables <% if has_variable?("dns_role") && dns_role != '''' then -%> include "/etc/apple_zones_<%= dns_role %>.conf"; <% end -%> ...result in this: // this line generated by Puppet based on config variables include "/etc/apple_zones_master.conf"; That''s the last line in named.conf, just telling the box to include the correct zones depending on master vs slave status. So it seems that Puppet is totally happy to detect if dns_role is empty, but not happy to tell me if it contains the value "master". What is wrong here? Thanks for following along, if you''re still with me. ;) -- 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.
Me <infosec@gmail.com> writes:> The nodes file:> node /dns[0-9]+/ inherits globals {> $dns_role = $hostname ? { # needs to be either "master" or "slave" > /dns01/ => [ "master" ], # the 01 box is always the > master by convention > default => [ "slave" ], > }> include "defaults" > include "host2dns" > }Oh. You''re not setting $dns_role to the string "master" or "slave". You''re setting $dns_role to an *array*, whose only member is "master" or "slave". That array is never going to equal a string (but as it turns out, it will stringify into the string value you expect). Change that to: $dns_role = $hostname ? { /dns01/ => ''master'', default => ''slave'', } instead, and I bet it will start working. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/> -- 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 Thu, Dec 23, 2010 at 6:49 PM, Russ Allbery <rra@stanford.edu> wrote:> > Oh. You''re not setting $dns_role to the string "master" or "slave". > You''re setting $dns_role to an *array*, whose only member is "master" or > "slave". That array is never going to equal a string (but as it turns > out, it will stringify into the string value you expect). > > Change that to: > > $dns_role = $hostname ? { > /dns01/ => ''master'', > default => ''slave'', > } > > instead, and I bet it will start working. >Arg. I copied that assignment from a place where I did set and use arrays, and here somehow I spaced that this was what I was copying when I used it here. Thanks guys, and thanks Russ. -- 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.