[augeas-devel] [Fwd: [Puppet Users] Re: Augeas and grub.conf]

David Lutterkort lutter at redhat.com
Tue Aug 4 23:24:55 UTC 2009


On Mon, 2009-08-03 at 15:28 +0100, Trevor Hemsley wrote:
> >> Having just spent about 2 hours trying to work out how to add a
> >> 
> >> password --md5 $1$Qejy8/$.qFUuDeYL.cuSDpN1ZD.S1
> >> 
> >> line to my grub.conf I thought it would be worth sharing how I finally
> >> got it to work.
> >> 
> >>         augeas {"/boot/grub/grub.conf":
> >>                 context => "/files/boot/grub/grub.conf",
> >>                 changes => [ "set timeout 15",
> >>                                 'set password/md5 null',
> >>                                 'set password $1$Qejy8/$.qFUuDeYL.cuSDpN1ZD.S1'
> >>                         ]
> >>                 }
> >> 
> >> Also the grub lens only works if /boot/grub/grub.conf resides on the
> >> same file system as /etc otherwise augtool craps out with an error about
> >> being unable to save a cross file system link. Short of editing the lens
> >> file, I'm not sure how to solve that one. If anyone knows how to fix
> >> that without the edit then that would be great :)
> >> 
> >Can you post this over on the augeas list[1]? Thanks!

You can tell Augeas to copy if it can't do the (much safer) write to
temp file + rename by setting /augeas/save/copy_if_rename_fails to some
arbitrary value.

> In addition, it baffles me a bit as to why the default location for grub.conf is
> /etc/grub.conf when, on Redhat based distros, it is always in /boot/grub/grub.conf
> with a symlink from /etc pointing to it. I think the standard RH installs always
> make /boot a separate partition so this lens will never work.

IIRC, on Debian it points somewhere else, so we'd need some variation
between RH and Debian. But if there's something that works for either,
and avoids the cross-device symlink I'd like to change the stock lens.

David





More information about the augeas-devel mailing list