On Tue, 2009-06-09 at 11:57 -0400, Bryan Kearney wrote: > Ok.. lets try this (lutter knows this voodoo better)
It's not voodoo, it's XPath ;) > "match *[alias ='usb-storage'] size = 0 " That almost works, though shouldn't that second '=' be '==' ? (and maybe we should make the augeas provider use '=' there, too, for consistency) I would write this as augeas { "usb-storage": context => "/files/etc/modprobe.conf", changes => [ "set alias[last()+1] usb-storage", "set alias[last()]/modulename off", ], onlyif => "match alias[.='usb-storage'] size == 0' } The fact that the modprobe.conf format is 'command args' with differing meanings of the args for the various commands doesn't matter too much - it just leads to different tree structures for those commands. For example for the command 'alias NAME MODULE' the tree structure is alias = 'NAME' modulename = 'MODULE' IOW, the name of the alias becomes the value of the 'alias' node, and the name of the module is put as the value of a node labelled 'modulename'. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---