Hi. I''d like to modify certain values in the config files on client machines. For example: in /boot/grub/menu.lst, change "timeout 10" to "timeout 3" I''d prefer not to create a template, since there''s no guarantee that the rest of menu.lst is the same (e.g., a kernel is updated on one client machine but not another). The sloppy solution I''m using now is exec''ing a sed command if /timeout\s+3/ is not found in the file. But it just seems tacky. Any suggestions on how to do this more properly? Good weekend to all. Kelly --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2009/9/12 Kelly Collier <jkellycollier@gmail.com>:> > Hi. > > I''d like to modify certain values in the config files on client machines. > > For example: > > in /boot/grub/menu.lst, change "timeout 10" to "timeout 3" > > I''d prefer not to create a template, since there''s no guarantee that the > rest of menu.lst is the same (e.g., a kernel is updated on one client > machine but not another). > > The sloppy solution I''m using now is exec''ing a sed command if > /timeout\s+3/ is not found in the file. But it just seems tacky.One option would be to use the augeas provider to do this: http://reductivelabs.com/trac/puppet/wiki/PuppetAugeas http://augeas.net/tour.html Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kelly Collier wrote:> Hi. > > I''d like to modify certain values in the config files on client machines. > > For example: > > in /boot/grub/menu.lst, change "timeout 10" to "timeout 3" > > I''d prefer not to create a template, since there''s no guarantee that the > rest of menu.lst is the same (e.g., a kernel is updated on one client > machine but not another). > > The sloppy solution I''m using now is exec''ing a sed command if > /timeout\s+3/ is not found in the file. But it just seems tacky. > > Any suggestions on how to do this more properly?augeas {"/boot/grub/grub.conf": context => "/files/boot/grub/grub.conf", changes => [ "set timeout 3", ], require => File["/usr/share/augeas/lenses/grub.aug"] } Because of a bug in the current Augeas I have a copy of /usr/share/augeas/lenses/dist/grub.aug in /usr/share/augeas/lenses/grub.aug where I''ve edited the hard coded location of /etc/grub.conf to /boot/grub/grub/conf, hence the require on the above. If your /etc is on the same disk partition as your /boot then you won''t need this. -- Trevor Hemsley Infrastructure Engineer ................................................. * C A L Y P S O * 4th Floor, Tower Point, 44 North Road, Brighton, BN1 1YR, UK OFFICE +44 (0) 1273 666 350 FAX +44 (0) 1273 666 351 ................................................. www.calypso.com This electronic-mail might contain confidential information intended only for the use by the entity named. If the reader of this message is not the intended recipient, the reader is hereby notified that any dissemination, distribution or copying is strictly prohibited. * P * /*/ Please consider the environment before printing this e-mail /*/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kelly Collier wrote:> Hi. > > I''d like to modify certain values in the config files on client machines. > > For example: > > in /boot/grub/menu.lst, change "timeout 10" to "timeout 3" > > I''d prefer not to create a template, since there''s no guarantee that the > rest of menu.lst is the same (e.g., a kernel is updated on one client > machine but not another). > > The sloppy solution I''m using now is exec''ing a sed command if > /timeout\s+3/ is not found in the file. But it just seems tacky. > > Any suggestions on how to do this more properly?For grub, check if your distro has "grubby", a command line tool for modifying the grub config file. Last I saw it was on RedHat/CentOS/Fedora; it''s not on the Debian I have here to hand, nor my Ubuntu, so I don''t know where it comes from. Other distros may have equivalents. Craig Miskell --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> augeas {"/boot/grub/grub.conf": > context => "/files/boot/grub/grub.conf", > changes => [ "set timeout 3", > ], > require => File["/usr/share/augeas/lenses/grub.aug"] > } > > Because of a bug in the current Augeas I have a copy of > /usr/share/augeas/lenses/dist/grub.aug in > /usr/share/augeas/lenses/grub.aug where I''ve edited the hard coded > location of /etc/grub.conf to /boot/grub/grub/conf, hence the require on > the above. If your /etc is on the same disk partition as your /boot then > you won''t need this.Automateit handles these in ruby. I wonder of some of the code that''s in automateit can be incorporated into puppet since they are both GPLed (automateit is GPL3). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>> augeas {"/boot/grub/grub.conf": >> context => "/files/boot/grub/grub.conf", >> changes => [ "set timeout 3", >> ], >> require => File["/usr/share/augeas/lenses/grub.aug"] >> } >> >> Because of a bug in the current Augeas I have a copy of >> /usr/share/augeas/lenses/dist/grub.aug in >> /usr/share/augeas/lenses/grub.aug where I''ve edited the hard coded >> location of /etc/grub.conf to /boot/grub/grub/conf, hence the require on >> the above. If your /etc is on the same disk partition as your /boot then >> you won''t need this. > > Automateit handles these in ruby. I wonder of some of the code that''s > in automateit can be incorporated into puppet since they are both > GPLed (automateit is GPL3).what do you mean with these? File editing? augeas is a completely different approach than a sed interface in ruby... But for sure you''re always free to add your own providers... cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---