On 27 Nov 2011, at 20:04, Graham Leggett wrote:

> I have a task to convince puppet and augeas to modify multiple postfix
> files, most specifically /etc/postfix/main.cf and /etc/postifx/
> acceptdomains.cf (and other LDAP related files), and I'm struggling to
> find out how to do that. I have found examples on how to use augeas to
> modify just one file at a time, but no information seems to be
> available when multiple files are involved.
> 
> I started with the config published here, and have no idea what to
> change to convince puppet+augeas to edit both /etc/postfix/main.cf
> and /etc/postfix/acceptdomains.cf at the same time:
> 
> https://github.com/camptocamp/puppet-postfix/blob/master/manifests/config.pp
> 
> Does anyone have a sample configuration on how you would modify
> multiple files at once, or have a clue on where to start?

Answering my own question, I've discovered that augeas doesn't support multiple 
files at all without a custom lens being created to support it.

Or to declare it more accurately, augeas only knows about specific files 
defined in specific locations, it has no concept of a general file in a general 
location that you might want to apply a lens to.

I eventually worked around the issue by making a custom lens copied from the 
augeas postfix_main.aug lens that listed the extra ldap templates as matching a 
wildcard, at this point augeas started working correctly.

Something else I discovered is that augeas has no error handling of any kind - 
if it doesn't recognise a file as matching one of the predetermined locations 
built into the lens, it will silently ignore the file, and not tell you why.

Regards,
Graham
--

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

Reply via email to