a job to remove postfix not-so-zombie undead processes
This commit is contained in:
parent
f8fb27b666
commit
49cb6d0bf8
1 changed files with 21 additions and 0 deletions
21
playbooks/death_to_postfix.yml
Normal file
21
playbooks/death_to_postfix.yml
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue