# Ansible doesn't fail when no host found using ec2.py

**URL:** <https://forum.ansible.com/t/ansible-doesnt-fail-when-no-host-found-using-ec2-py/23841>\
**Category:** Ansible Project\
**Created:** [February 28, 2017, 12:38pm UTC](https://forum.ansible.com/t/ansible-doesnt-fail-when-no-host-found-using-ec2-py/23841 "2017-02-28T12:38:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![irfad](https://avatars.discourse-cdn.com/v4/letter/i/48db29/32.png) [@irfad](https://forum.ansible.com/u/irfad)\
**Post date:** [February 28, 2017, 12:38pm UTC](https://forum.ansible.com/t/ansible-doesnt-fail-when-no-host-found-using-ec2-py/23841/1 "2017-02-28T12:38:27Z")

</div>

```auto
Sometimes (not very often) Ansible doesn't pick the dynamic inventory ip using ec2.py and when it happens usually it should fail the job, but instead it will SUCCESS the task which prevents us from notifying that the task has not been run properly on the server.

```

```auto

```

```auto
example below.

```

```auto

PLAY RECAP *********************************************************************

Finished: SUCCESS

```

```auto

```

```auto
Is there any way to fail the job is such situations?

```

```auto

```

```auto
Please help

```
