[Puppet-dev] Re: [augeas-devel] Re: Augeas and Puppet

Raphaël Pinson raphink at gmail.com
Tue Aug 12 08:11:05 UTC 2008


On Mon, Aug 4, 2008 at 8:23 PM, David Lutterkort <dlutter at redhat.com> wrote:

>
> On Mon, 2008-08-04 at 16:39 +0200, Kjetil Torgrim Homme wrote:
> > 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"
> > >           ]
> > >         }
>


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



Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080812/e05506e8/attachment.htm>


More information about the augeas-devel mailing list