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

Trevor Hemsley trevor.hemsley at codefarm.com
Mon Aug 3 14:28:14 UTC 2009


>> 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!

Reposting from the puppet list at request.

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.

Restoring my edit to /usr/share/augeas/lenses/dist/grub.conf so that it points to
/etc/grub.conf again and running

augtool> set /files/etc/grub.conf/timeout 25
augtool> save
Saving failed
augtool> print /augeas//error/
/augeas/files/etc/sudoers/error = "parse_failed"
/augeas/files/etc/sudoers/error/pos = "2427"
/augeas/files/etc/sudoers/error/line = "66"
/augeas/files/etc/sudoers/error/char = "0"
/augeas/files/etc/sudoers/error/lens = "/usr/share/augeas/lenses/dist/sudoers.aug:480.10-.57"
/augeas/files/etc/sudoers/error/message = "Iterated lens matched less than it should"
/augeas/files/etc/grub.conf/error = "rename_augnew"
/augeas/files/etc/grub.conf/error/message = "Invalid cross-device link"
augtool>


-- 

Trevor Hemsley
Infrastructure Engineer
.................................................
* C A L Y P S O
* Brighton, 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 /*/




More information about the augeas-devel mailing list