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

Bryan Kearney bkearney at redhat.com
Tue Aug 12 10:18:00 UTC 2008



Raphaël Pinson wrote:
> 
> 
> On Mon, Aug 4, 2008 at 8:23 PM, David Lutterkort <dlutter at redhat.com 
> <mailto:dlutter at redhat.com>> wrote:
> 
> 
>     On Mon, 2008-08-04 at 16:39 +0200, Kjetil Torgrim Homme wrote:
>      > David Lutterkort <dlutter at redhat.com <mailto: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.

David and I disucssed this (not running if necessary) and it comes down 
to your definition of idemotent. It can be argued that if state is the 
same after puppet executes, then wether augeas ran or not is a 
performance issue only... not really affecting the idempotency.

Having said that, I like the onlyif. Would you want it to default to the 
execs onlyif if not a get or a match? Or.. just assume augeas only for 
the onlyif?

-- bk




More information about the augeas-devel mailing list