On Tue, 2009-07-28 at 09:53 -0400, Trevor Vaughan wrote:> All,
>
> I''m trying to figure out the best way to use augeas to manage
grub.conf.
>
> The issue is that I want users to be able to do whatever they like but:
>
> 1) The active, running, kernel should be the default *fallback*
AFAIK, you want ''fallback saved'' and have a
''savedefault'' in every boot
stanza (not that I''ve ever tried that)
> 2) I need to be able to set the ''default'' to the last
entry added
>
> I''ve tried something like:
>
> set default /files/etc/grub.conf/count(title)
>
> But, I''m obviously missing something.
>
> Any hints?
You have to write a custom type/plugin - the Augeas type won''t let you
do what you need to do. In Ruby, you''d do something like
aug = Augeas.open(nil, nil, 0)
num_stanzas = aug.match("/files/etc/grub.conf/title").size
aug.set("/files/etc/grub.conf/title", num_stanzas.to_s)
aug.save
aug.close
David
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---