Here is a weird thing:
When running /etc/init.d/milter-greylist restart via ansible (either direct or via a playbook) it hangs. I had no time to debug this, so I reverted to the next best workaround since the machine was already running monit:
Have ansible distribute greylist.conf and then have monit restart the process. So here is a simple playbook:
- hosts: greylist user: root tasks: - name: copy local milter-greylist configuration to hosts action: copy src=/usr/local/etc/greylist.conf dest=/etc/milter-greylist/greylist.conf
and here is how monit finishes the task:
check file greylist.conf with path /etc/milter-greylist/greylist.conf if changed checksum then exec "/etc/init.d/milter-greylist restart"
Of course this is just a simple case of having the two cooperate. But once you get the hang of it, more elaborate schemes where ansible and monit can cooperate will pop out.
requiretty: If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin scripts. This flag is off by default.
I was working on a machine that had:
and got bit by that.