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.

Reply via email to