Hi,
Something I have been confronted with at a few customers in the past and I was looking how Ansible could solve this particular issue.
Typically the customer has hundreds of systems with cron-jobs (both system cron-jobs as well as custom cron-jobs) and some of these cron-jobs are sending mails about problems/errors, and they all end up in /var/spool/mail/root.
What I usually recommend is having root-mail set up to send mail to a team-mailbox after first carefully fixing all the issues on each of the servers (most of these issues are not specific to a server so this tends to be fixing a handful of problems on all servers, e.g. using Ansible).
But some of these customers don't want or simply cannot send out these mails and as a result new issues are getting queued in root's mailbox with nobody addressing them. (Sometimes every X minutes or every hour)
So my Ansible solution that I was just thinking of would be a module (e.g. flushmail) that would automatically flush /var/spool/mail/root and queue those mails on the management server to root (possibly adding the server-name to the subject). Another possibility could be to send it to the user that is running Ansible, or write it out to different mailboxes (one per server).
Now, would this be something that is more generally useful and/or what other functionality could be useful in this light ? And how should it behave by default ?
Kind regards,