Hi Dominic,

Yeah, multiple augeas resources is the problem.

The comment is a reasonable idea but I think it'll be more work than
just falling back to concat.

Thanks,

Trevor

On Wed, Jul 25, 2012 at 11:35 AM, Dominic Cleal <dcl...@redhat.com> wrote:
> On 25/07/12 16:01, Trevor Vaughan wrote:
>> I've been searching around but haven't found a way to do something
>> like a purge with augeas.
>>
>> If you have a file such as
>>
>> [iniheader]
>> entry1 (managed by puppet)
>> entry2 (not managed by puppet)
>>
>> And you want to add 'entry3' as well as removing anything not managed
>> by puppet in that subsection then you currently do not have this
>> capability.
>
> In your Augeas resource, you could `rm` all other settings before
> setting your own within a single resource.  If this produces no actual
> change in the written config file then the resource won't "change" either.
>
> rm /files/etc/foo.ini/iniheader/*
> set /files/etc/foo.ini/iniheader/entry1 foo
> set /files/etc/foo.ini/iniheader/entry2 bar
>
> If you're managing the same section across multiple Augeas resources
> (e.g. more of a use case for Puppet's purge) then I don't think there's
> a good solution.  Perhaps you could mark your Puppet-managed resources
> with a comment (a #comment subnode usually) and then delete anything
> that doesn't match it.
>
> --
> Dominic Cleal
> Red Hat Consulting
> m: +44 (0)7817 878113
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaug...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to