# Event Driven with ansible

**URL:** <https://forum.ansible.com/t/event-driven-with-ansible/28928>\
**Category:** Ansible Project\
**Created:** [November 2, 2018, 11:43am UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928 "2018-11-02T11:43:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sathya\_Narayanan](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sathya\_Narayanan](https://forum.ansible.com/u/Sathya_Narayanan)\
**Post date:** [November 2, 2018, 11:43am UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/1 "2018-11-02T11:43:07Z")

</div>

Hello All,

just thought of checking, is ansible capable of doing EDI ( event-driven )?

I search some article on the internet and I found some saying its possible and some saying it’s not, kind of confusing :(.

If possible, can you please guide me some article which talks more about it.

Regards,  
Sathya.R

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 2, 2018, 3:02pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/2 "2018-11-02T15:02:28Z")

</div>

ansible itself does not have an event handler, but it is easy to  
execute from one, bet it Tower/Awx, cron, incron, etc.

---

<div class="post-metadata">

**Author:** ![Sathya\_Narayanan](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sathya\_Narayanan](https://forum.ansible.com/u/Sathya_Narayanan)\
**Post date:** [November 2, 2018, 3:19pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/3 "2018-11-02T15:19:57Z")

</div>

Wow… that’s great, can you share me some documentation or use case on the event-driven with Ansible.

I use ansible AWX for web UI.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 2, 2018, 4:02pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/4 "2018-11-02T16:02:14Z")

</div>

I'm not sure what you want, that is a very generic ask, everything  
from a AWX/Tower callback url to an flagf ile in the filesystem for  
incron to trigger.

I even have an example of using an email filter to trigger Ansible  
depending on email subject  
[https://image.slidesharecdn.com/ansibletipstricks-150604194554-lva1-app6892/95/ansible-tips-tricks-6-638.jpg?cb=1433447208](https://image.slidesharecdn.com/ansibletipstricks-150604194554-lva1-app6892/95/ansible-tips-tricks-6-638.jpg?cb=1433447208)  
\< from very old presentation

---

<div class="post-metadata">

**Author:** ![Sathya\_Narayanan](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sathya\_Narayanan](https://forum.ansible.com/u/Sathya_Narayanan)\
**Post date:** [November 2, 2018, 6:17pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/5 "2018-11-02T18:17:29Z")

</div>

Ah, that’s not what I am look for. What I am trying to achieve is based on Nagios event ansible to execute pre defined playbooks for remidiating the errors

Just the way event handler works in Nagios or similar to reactor in salstack.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 2, 2018, 6:41pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928/6 "2018-11-02T18:41:43Z")

</div>

Just set a play as an event handler script, use a shebang and make the  
file executable, the same slide deck contains an example on how to do  
that.
