On Tue, Jun 9, 2009 at 11:57 AM, Bryan Kearney <bkear...@redhat.com> wrote:
> > lance dillon wrote: > > On Tue, Jun 9, 2009 at 11:16 AM, Bryan Kearney <bkear...@redhat.com> > wrote: > > > >> lance dillon wrote: > >>> I need to be able to add: > >>> > >>> alias usb-storage off > >>> > >>> to /etc/modprobe.conf > >>> > >>> I have this so far: > >>> > >>> augeas { "usb-storage": > >>> context => "/files/etc/modprobe.conf", > >>> changes => [ "set alias[last()+1] usb-storage", > >>> "set alias[last()]/modulename off", > >>> ], > >>> onlyif => "get alias != usb-storage" > >>> } > >> > >> try onlyif => "match alias include usb-storage" > >> > >> it may be > >> > >> "match alias[*] include usb-storage" > >> > >> -- bk > >> > >> > >> Hmm, that didn't quite do it either. Now it doesn't run regardless. It > is > > supposed to add that line if usb-storage doesn't exist, and ignore if it > > does (I don't want to add it multiple times). The logic above seems to > be > > the opposite, but either way, nothing happened. > > > > Thanks for the info though. Now I have another command to check with > (using > > include). > > > > Ok.. lets try this (lutter knows this voodoo better) > > "match *[alias ='usb-storage'] size = 0 " > > -- bk > Seems closer, but not quite. augtool> match /files/etc/modprobe.conf/alias[*] /files/etc/modprobe.conf/alias[1] = eth0 /files/etc/modprobe.conf/alias[2] = scsi_hostadapter /files/etc/modprobe.conf/alias[3] = scsi_hostadapter1 /files/etc/modprobe.conf/alias[4] = char-major-14 /files/etc/modprobe.conf/alias[5] = usb-storage augtool> match /files/etc/modprobe.conf/alias[*='usb-storage'] (no matches) augtool> match /files/etc/modprobe.conf/alias[='usb-storage'] (error matching /files/etc/modprobe.conf/alias[='usb-storage']) augtool> match /files/etc/modprobe.conf/alias[*='usb-storage'] (no matches) augtool> match /files/etc/modprobe.conf/alias[*="usb-storage"] (no matches) This may give more information. thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---