On Mon, Aug 4, 2008 at 8:23 PM, David Lutterkort <[EMAIL PROTECTED]> wrote:

>
> On Mon, 2008-08-04 at 16:39 +0200, Kjetil Torgrim Homme wrote:
> > David Lutterkort <[EMAIL PROTECTED]> 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
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to