[augeas-devel] Improving Augeas' idempotence in Puppet
David Lutterkort
lutter at redhat.com
Thu Apr 12 22:42:11 UTC 2012
On Fri, 2012-04-06 at 01:26 -0700, Raphaël Pinson wrote:
> As of today, the way the Augeas provider in Puppet manages idempotence
> can be somehow problematic. The `onlyif` statements can only be
> evaluated on the client, so all Augeas resources are generally run on
> the client, and whether to run them cannot be easily determined in the
> catalog, unless it relies on other resources as dependencies or on
> custom facts (possibly using the Augeas ruby library).
Isn't that completely analogous to a package statement that wants to
have 'httpd' installed ? There's no way the server can know whether this
amounts to a noop or not - it requires checking on the client, and for
almost all runs, the statement will amount to a noop. I don't think it's
that big a deal.
Slightly OT: part of my evil plan with aug_srun was to embed simple
logic in the language aug_srun interprets; I am slightly hesitant to do
that, because augeas contains way too many interpreters as it is, and
inventing little languages is generally a bad idea, but it's just too
tempting to allow something like
if ! /files/etc/hosts/*[canonical = 'lemon.example.com']
set /files/etc/hosts/01/ipaddr 192.168.0.4
set /files/etc/hosts/01/canonical lemon.example.com
set /files/etc/hosts/01/alias lemon
set /files/etc/hosts/01/alias meyer
end
This will require inventing syntax for 'if .. then .. else .. end'; I'd
use path expressions as the conditionals and coerce them to bools.
> A new aug_to_xml() API call has been added in Augeas 0.10.0 allowing
> to export the whole (or part of the) Augeas tree as an XML document.
I'd worry that that will have a serious impact on puppet; not just
because of the data that needs to cross the wire on every run, but also
because of the deserialization overhead on the server.
David
More information about the augeas-devel
mailing list