From 49cb6d0bf894343cc58c21a47a0b5ffabaa3ca75 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Wed, 12 Mar 2014 20:22:56 +0000 Subject: [PATCH] a job to remove postfix not-so-zombie undead processes --- playbooks/death_to_postfix.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 playbooks/death_to_postfix.yml diff --git a/playbooks/death_to_postfix.yml b/playbooks/death_to_postfix.yml new file mode 100644 index 0000000000..1ca1007ffe --- /dev/null +++ b/playbooks/death_to_postfix.yml @@ -0,0 +1,21 @@ +# requires --extra-vars="target='host1;host2;group'" +# thanks threebean on this. + +- name: kills postfix which has been left around alive after update. + hosts: "{{ target }}" + user: root + + + tasks: + - name: Try to stop postfix cleanly. + service: name=postfix state=stopped + + # This doesn't really remove the pid file.. but we say it does so ansible only runs it if the pid file is there.. + - name: Really kill postfix master process + command: pkill -u root master removes=/var/spool/postfix/pid/master.pid + + - name: Clean up old pid lock file. + command: rm /var/spool/postfix/pid/master.pid removes=/var/spool/postfix/pid/master.pid + + - name: Try to start postfix cleanly + service: name=postfix state=started