[Puppet-dev] Re: [augeas-devel] Re: Augeas and Puppet
David Lutterkort
dlutter at redhat.com
Wed Aug 13 04:23:27 UTC 2008
On Tue, 2008-08-12 at 10:11 +0200, Raphaël Pinson wrote:
> I see an issue with this approach somehow. Puppet is "state-centered",
> while Augeas is "change-centered". If you write a module that will
> apply changes using Augeas, it will apply these changes at every run
> of Puppet... Now Puppet resources usually have a state checker so that
> the changes are only applied if a condition is met.
At some point somebody has to turn a state description into actions -
the question is whether that should happen in Puppet or in Augeas.
> I think it would be suitable for the augeas module to work this way,
> too :
>
>
> 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"
> ],
> onlyif => "get fedora.repo/fedora/enable != '1'"
>
> }
>
>
> onlyif could take conditions based on "get" or "match" requests. Also,
> the Puppet module could check all the values for the "set" actions and
> only apply those that don't match.
That's what I was thinking initially, too, but then figured that it will
be much simpler if Augeas checks whether a change has actually been
made; I intend to add a flag to aug_init so that Augeas will only ever
touch a file if it truly changed.
The onlyif guard is a good idea - I can see how that would provide a lot
more expressiveness.
David
More information about the augeas-devel
mailing list