Answer the question
In order to leave comments, you need to log in
How to make it so that ansible sends a letter to the mail when an error occurs during the execution of the playbook?
---
- hosts: doc
tasks:
- name: rm
shell: rm -rf /tmp/ansbl12
- name: mkdir
shell: mkdir /tmp/ansbl12
- shell: /usr/bin/uptime
register: out
- debug: var= out.stderr
handlers:
- mail:
host='ru.ru.ru.ru'
port=25
to=""
from="Ansible "
subject='Ansible-report'
body='System {{ ansible_hostname }} has been successfully provisioned.'
Answer the question
In order to leave comments, you need to log in
Well, write the acquisition yourself, if the playbook fails, send the same email to yourself, well, or put it in what jengkins thread
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question