[augeas-devel] question about inserting entry to end, specifically with fstab lens

Greg_Swift at aotx.uscourts.gov Greg_Swift at aotx.uscourts.gov
Thu Feb 17 20:52:42 UTC 2011


I was browsing around looking for how to added fstab entries with augeas
+puppet and ran across a blog entry.

http://mrpointy.wordpress.com/2010/05/01/augeas-and-appending-lines-to-etcfstab/

The other suggests a hack of using a zero-padded number to append entries
to the list, but in the commends both the ins and a change to the lens are
mentioned as solutions around this.  What the author calls a hack seems to
be the way the quick tour tells you to do this.

 I don't see how the ins method would work unless you know the number of
the last entry.  And to be quite honest, I can't figure out how to use
insert to add a sequential entry anyway.  When I tried 'ins 7
after /files/etc/fstab/6' I just got a 7 that was an entry not a node.
Using 'set /files/etc/fstab/7/file /path' I get what I'm expecting.

The blog commenter's change from seq to label seems to work, and seems to
be the more intuitive and effective method, but it requires a change to the
lens and API  for that file that would likely cause regression issues.

My question is what is the preferred method of appending after the last
entry, general would be nice but most specifically in /etc/fstab?

thoughts?

-greg

ps. yes, with a script or manually adding to the end could be easy just by
iterating.  However with a generic definition in puppet I don't think its
as applicable.  Maybe I'm wrong, feel free to enlighten me.

pps. sorry if i got any of my terminology wrong




More information about the augeas-devel mailing list