Thomas Bellman wrote: > I'm reading about Augeas to see what can be done with it, and > with the new 'augeas' resource type in 0.24.7. So far I have > only played using augtool, not the Puppet integration, but I > have a few questions:
The type is basically a wrapper around augtool. So.. the answer may be "the same way". However, it may help to map the parameters in the type to the augtool. Here they are: * PARAMATER | Augtool Equivilant * root | augtool -r option * load_path | augtool -I option * type_check | augtool -c option * name | Nop real mapping. Used becuase puppet needs an ID * changes | maps to the command in augtool. * Contxt | No real mapping. It is used to avoid typing the complete path name * onlyif | No real mapping, used to control processing Let me address some more below. David Lutterkort may be able to provide better detail or approaches. > > > 1. Is it possible to specify what lens to use for editing a > certain file? Can I for instance tell it to use the sshd lens > to edit an sshd config file in a non-standard place? Or to > use the shellvars lens to edit /etc/sysconfig/sendmail (the > version of Augeas in Fedora 9 happily edits lots of other > files in /etc/sysconfig, but not the sendmail file). Do I > have to write a new lens for this? I believe you would have to copy the lens to a new location, and use the load_path parameter. > > > 2. How do I modify an entry in the tree, as opposed to rewrite it > with a fixed string? For example, the grub.conf file has > lines saying > > kernel /vmlinuz-2.6.27.5-41.fc9.x86_64 ro root=/dev/sda2 rhgb quiet > > and I want to remove the words "rhgb" and "quiet". Just doing > > set /files/etc/grub.conf/title[1]/kernel > "/vmlinuz-2.6.27.5-41.fc9.x86_64 ro root=/dev/sda2" > > is the wrong answer, because I might not know what "/dev/sda2" > should be on every system, and I certainly do not know what > the version of the kernel should be. > > You might think that I could use the $kernelrelease fact, but > the kernel line I want to modify might not be for the kernel > that is actually running. I believe this logic would need to be outside of the type creating the line in a variable. Then you can set the variable in the augeas type. > > > 3. Continuing the above grub.conf example, there may be an unknown > number of kernel lines that need to be modified. How do I get > augeas to modify all of them in the above way? I believe you can set using wildcards to support this. > > > 4. In the /etc/logrotate.conf file in Fedora and CentOS, there is > an entry on the form: > > /var/log/wtmp { > monthly > create 0664 root utmp > rotate 1 > } > > I want to comment out, or remove entirely, that entry. I can > find it with > > match /files/etc/logrotate.conf/*/file "/var/log/wtmp" > > which right now happens to give me > > /files/etc/logrotate.conf/rule[1]/file > > After finding that information, I want to do > > rm /files/etc/logrotate.conf/rule[1] > > but how do I feed the information from the match back to the > rm command? I dont know of a way off hand. Lemme bug David about this one. -- bk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---