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

Raphaël Pinson raphink at gmail.com
Wed Aug 13 14:36:35 UTC 2008


On Wed, Aug 13, 2008 at 4:22 PM, Bryan Kearney <bkearney at redhat.com> wrote:

>
>
> Raphaël Pinson wrote:
>
>>
>>
>> On Wed, Aug 13, 2008 at 6:23 AM, David Lutterkort <dlutter at redhat.com<mailto:
>> dlutter at redhat.com>> wrote:
>>
>>    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.
>>
>
>
> Just to check. I assume get would support = != > < assuming strings. What
> would you expect for match? Would it be array cmparisons such as includes,
> isEmpty, length?
>


For get, I'd expect to test the value of the node. For match, I'd expect to
test the array of nodes returned, for example testing how many nodes matched
the expression.

e.g.
If get returns no value, it means the value of the node is empty.
If match returns no value, it means there is no such node.



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


More information about the augeas-devel mailing list