iamauser
2013-Mar-22 18:48 UTC
[Puppet Users] puppet augeas with more than one array in a single key
I am trying to put together a set of puppet policies for grub/menu.lst. The serial::grubmenulst looks like this : define serial::grubmenulst ( $value ) { $key = $title $context = "/files/boot/grub/menu.lst" augeas { "grubmenulst/${key}": context => "$context", onlyif => "get $key != ''$value''", changes => "set $key ''$value''", } } It is implemented in the following way : $svar = "${serial_tty},${serial_speed}n8r" serial::grubmenulst { "terminal/console" : value => ""; "title[1]/kernel/elevator" : value => "deadline"; "title[1]/kernel/console[1]" : value => "${svar}"; *### It Fails for this Line otherwise it works* } Puppet agent complains during the run (see below). Note that, the code works if I comment out the last line: "title[1]/kernel/console[1]" : value => "${svar}". My initial guess is that puppet-augeas is not able to parse more than one array values for a single key... (!?) Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type serial::grubmenulst at /etc/puppet/modules/serial/manifests/serial.pp:16 on node <hostname> Any suggestions ? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
iamauser
2013-Mar-23 13:23 UTC
[Puppet Users] Re: puppet augeas with more than one array in a single key
Anyone, Dude ! Sir ? NOTE : I am using Puppet-3.0.2.x. On Friday, March 22, 2013 1:48:55 PM UTC-5, iamauser wrote:> > I am trying to put together a set of puppet policies for grub/menu.lst. > The serial::grubmenulst looks like this : > > define serial::grubmenulst ( $value ) { > $key = $title > $context = "/files/boot/grub/menu.lst" > augeas { "grubmenulst/${key}": > context => "$context", > onlyif => "get $key != ''$value''", > changes => "set $key ''$value''", > } > } > > It is implemented in the following way : > > $svar = "${serial_tty},${serial_speed}n8r" > serial::grubmenulst { > "terminal/console" : value => ""; > "title[1]/kernel/elevator" : value => "deadline"; > "title[1]/kernel/console[1]" : value => "${svar}"; *### It Fails > for this Line otherwise it works* > } > > Puppet agent complains during the run (see below). Note that, the code > works if I comment out the last line: "title[1]/kernel/console[1]" : > value => "${svar}". My initial guess is that puppet-augeas is not able > to parse more than one array values for a single key... (!?) > > Error: Could not retrieve catalog from remote server: Error 400 on > SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: > Invalid resource type serial::grubmenulst at > /etc/puppet/modules/serial/manifests/serial.pp:16 on node <hostname> > > Any suggestions ? >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Ellison Marks
2013-Mar-24 07:19 UTC
[Puppet Users] Re: puppet augeas with more than one array in a single key
Might be that last semicolon screwing things up. I think the parser might be expecting another resource after that. Doesn''t exactly make sense, as you have a semicolon ending the line above, so if you commented that last line, it would be the same, but it''s a thought. On Saturday, March 23, 2013 6:23:12 AM UTC-7, iamauser wrote:> > Anyone, Dude ! Sir ? > > NOTE : I am using Puppet-3.0.2.x. > > > > On Friday, March 22, 2013 1:48:55 PM UTC-5, iamauser wrote: >> >> I am trying to put together a set of puppet policies for grub/menu.lst. >> The serial::grubmenulst looks like this : >> >> define serial::grubmenulst ( $value ) { >> $key = $title >> $context = "/files/boot/grub/menu.lst" >> augeas { "grubmenulst/${key}": >> context => "$context", >> onlyif => "get $key != ''$value''", >> changes => "set $key ''$value''", >> } >> } >> >> It is implemented in the following way : >> >> $svar = "${serial_tty},${serial_speed}n8r" >> serial::grubmenulst { >> "terminal/console" : value => ""; >> "title[1]/kernel/elevator" : value => "deadline"; >> "title[1]/kernel/console[1]" : value => "${svar}"; *### It Fails >> for this Line otherwise it works* >> } >> >> Puppet agent complains during the run (see below). Note that, the code >> works if I comment out the last line: "title[1]/kernel/console[1]" : >> value => "${svar}". My initial guess is that puppet-augeas is not able >> to parse more than one array values for a single key... (!?) >> >> Error: Could not retrieve catalog from remote server: Error 400 on >> SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: >> Invalid resource type serial::grubmenulst at >> /etc/puppet/modules/serial/manifests/serial.pp:16 on node <hostname> >> >> Any suggestions ? >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.