S
S
sergeyxx12xx2016-03-25 09:08:37
Ansible
sergeyxx12xx, 2016-03-25 09:08:37

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

1 answer(s)
P
Puma Thailand, 2016-03-25
@opium

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 question

Ask a Question

731 491 924 answers to any question