ansible-msmtp-mailer/handlers/main.yml
2021-07-12 21:39:30 +02:00

19 lines
463 B
YAML
Executable file

---
# sending test mail using 'mail' command to root and test recipient
- name: test mail
shell: |
echo "Test mail from new/updated mSTMP\n\n $(uname -a)" |
mail -s "Test mSMTP at $(hostname -f)"
root "{{ msmtp_test_mail_recipient }}"
tags: mail
when: msmtp_send_test_mail
async: 30
poll: 5
- name: restart msmtpd
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: msmtpd
when: ansible_os_family == "RedHat"