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