On 12/04/11 23:43, russell.fulton wrote: > On Apr 13, 4:16 am, Adam Heinz <a...@metricwise.net> wrote: >>> context => "/etc/network/interfaces", >> >> Shouldn't this be "/files/etc/network/interfaces"? > > Thanks! that was the thing I was missing. > > The iface stuff works fine now but I can't figure out how to add a new > auto line > > "set auto[. = 'eth1'] eth1", > > gives an error on save ? > > augtool shows auto[1] having multiple values: > > augtool> ls /files/etc/network/interfaces/auto > 1 = lo > 1 = eth0 > > so how should I add entries?
So that method is trying to set the value of auto to 'eth1', but the tree layout has a '1' node under each 'auto' node. The best way to see this is to look at augtool's print command: augtool> print /files/etc/network/interfaces/auto /files/etc/network/interfaces/auto[1] /files/etc/network/interfaces/auto[1]/1 = "lo" /files/etc/network/interfaces/auto[2] /files/etc/network/interfaces/auto[2]/1 = "eth0" When setting it, you need to have the '1' node in there too: set auto[child::1 = 'eth1']/1 eth1 > and by the way > http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Augeas > is the best augtool documentation I found -- more in depth than the > quick tour on the augtool site. Yep, the quick tour is limited. The wiki has some very useful info hidden on it about constructing expressions, in particular: http://augeas.net/page/Path_expressions http://augeas.net/docs/tree.html There isn't much specific to augtool as it mirrors the API itself. What you might find useful is a new book that Raphaƫl Pinson's been working on, which starts explaining it from the beginning - it's still work in progress though. https://github.com/raphink/Augeas-book/ (you'll need to clone and 'make' it) Lastly, there are a few of us in #augeas on Freenode who can lend you a hand with expressions if you get stuck. -- Dominic Cleal Red Hat Consulting m: +44 (0)7818 512168 -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.