ansible/playbooks/death_to_postfix.yml
Ryan Lerch 691adee6ee Fix name[casing] ansible-lint issues
fix 1900 failures of the following case issue:

`name[casing]: All names should start with an uppercase letter.`

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-14 20:20:07 +10:00

22 lines
749 B
YAML

# 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