midair77
2011-Nov-07 21:45 UTC
[Puppet Users] why puppet template erb convert On to true, Off to false?
Dear all, I have a parameterized class and I have my ECN in perl as followed: classes{''myclass''} = { "abc" => On,}; and in my template erb: SecRuleEngine <%= abc %> ---- When I applied this to my puppet agent, I would then get: SecRuleEngine true. How is that On becomes true and Off becomes false? How can I fix this? Thank you very much. -- 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.
Nigel Kersten
2011-Nov-07 22:39 UTC
Re: [Puppet Users] why puppet template erb convert On to true, Off to false?
On Mon, Nov 7, 2011 at 1:45 PM, midair77 <midair77@gmail.com> wrote:> Dear all, > > I have a parameterized class and I have my ECN in perl as followed: > > classes{''myclass''} = { "abc" => On,}; > > and in my template erb: > > SecRuleEngine <%= abc %> > > ---- > > When I applied this to my puppet agent, I would then get: > > SecRuleEngine true. > > How is that On becomes true and Off becomes false? How can I fix > this? >Do you get exactly the same thing if you quote "On" so it''s actually a string? I''m not sure which part of Ruby is doing the magical translation that you don''t want, but you definitely shouldn''t get it if you tell Puppet that "On" is a string. -- 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.
midair77
2011-Nov-07 23:38 UTC
[Puppet Users] Re: why puppet template erb convert On to true, Off to false?
I actually put "On" in double quote in my ECN and I did not get the desired output. This is quite weird as why On/Off has been converted to true/false in erb template. Thank you, Nigel. On Nov 7, 2:39 pm, Nigel Kersten <ni...@puppetlabs.com> wrote:> On Mon, Nov 7, 2011 at 1:45 PM, midair77 <midai...@gmail.com> wrote: > > Dear all, > > > I have a parameterized class and I have my ECN in perl as followed: > > > classes{''myclass''} = { "abc" => On,}; > > > and in my template erb: > > > SecRuleEngine <%= abc %> > > > ---- > > > When I applied this to my puppet agent, I would then get: > > > SecRuleEngine true. > > > How is that On becomes true and Off becomes false? How can I fix > > this? > > Do you get exactly the same thing if you quote "On" so it''s actually a > string? > > I''m not sure which part of Ruby is doing the magical translation that you > don''t want, but you definitely shouldn''t get it if you tell Puppet that > "On" is a string.-- 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.
Nigel Kersten
2011-Nov-08 01:37 UTC
Re: [Puppet Users] Re: why puppet template erb convert On to true, Off to false?
On Mon, Nov 7, 2011 at 3:38 PM, midair77 <midair77@gmail.com> wrote:> I actually put "On" in double quote in my ECN and I did not get the > desired output. > > This is quite weird as why On/Off has been converted to true/false in > erb template. >Ah, I missed that you''ve got a Perl ENC. Can you run your ENC by hand and paste the YAML output of the node definition like this? e.g. /path/to/enc nodename and you should get the YAML output. -- Nigel Kersten Product Manager, Puppet Labs -- 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.