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:


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?


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.


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?


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?


That will do for now. :-)


        /Bellman

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to