[augeas-devel] Re: Augeas and Puppet

Kjetil Torgrim Homme kjetilho at linpro.no
Mon Aug 4 14:39:26 UTC 2008


David Lutterkort <dlutter at redhat.com> writes:
> As Bryan said, that's pretty close to how his Augeas type currently
> works. You'd write
>
>         augeas { "some-random-name":
>           context => "/files/etc/yum.repos.d",
>           changes => [
>             "set fedora.repo/fedora/enabled 1",
>             "set fedora.repo/fedora/gpgcheck 1",
>             "set fedora-updates.repo/fedora-updates/enabled 1",
>             "set fedora-updates.repo/fedora-updates/gpgcheck 1"
>           ]
>         }
>         
> 'context' is just a convenience so you don't have to type the same
> path prefix over and over, and all the relative paths in 'changes'
> are relative to that.

this solves the atomicity problem very nicely, but it will be
difficult for Augeas to find the filenames and lens(es) without
evaluating all lenses.

> For now, there's no way to specify a specific lens - the assumption
> is that the lenses installed on the system agree with what you're
> doing in your puppet manifest.

a reasonable assumption, I'm just worried about performance.

>> (I think the /system/config concept is a bit too ambitious for now,
>> hence "generic-ini".)
>
> Not sure I understand what that means.

to put all configuration in a single tree, Augeas needs to be
omniscient and know all paths and software versions (e.g., is
/etc/exim.conf for version 3 or 4?  should /etc/syslog.conf be parsed
according to Linux or Solaris rules?).  the problem is there for
/files/*, too, but with /system/config it's much worse.  just agreeing
on a cross-platform tree for network configuration is a very tall
order, and I'm not even sure if it is right that Augeas enters this
territory -- this should be handled by Puppet IMHO.

> Yeah, to make that more usable from puppet, Augeas needs a more
> complete XPath[1] implementation, so that you can say things like
>
>         augeas {
>           context => "/files/etc/hosts/*[ipaddr = '127.0.0.1']",
>           changes => [ .. ]
>         }
>
> to make changes to the line in /etc/hosts that talks about
> localhost.
>
> [1] http://www.w3.org/TR/xpath

that would be very nice!
-- 
regards,
Kjetil T. Homme
Linpro AS




More information about the augeas-devel mailing list