# introduce exception in inventory with all option

**URL:** <https://forum.ansible.com/t/introduce-exception-in-inventory-with-all-option/30747>\
**Category:** Ansible Project\
**Created:** [July 10, 2019, 4:17pm UTC](https://forum.ansible.com/t/introduce-exception-in-inventory-with-all-option/30747 "2019-07-10T16:17:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcos\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Marcos\_Gonzalez](https://forum.ansible.com/u/Marcos_Gonzalez)\
**Post date:** [July 10, 2019, 4:17pm UTC](https://forum.ansible.com/t/introduce-exception-in-inventory-with-all-option/30747/1 "2019-07-10T16:17:27Z")

</div>

Hi all

Im checking to use dynamic inventory but Im having a problem when execute any tasks with all option because with dynamic inventory exists some servers that never connects for external reasons. Exist any form to introduce exceptions in hosts?

Exemple:

---

<div class="post-metadata">

**Author:** ![Marcos\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Marcos\_Gonzalez](https://forum.ansible.com/u/Marcos_Gonzalez)\
**Post date:** [July 10, 2019, 4:32pm UTC](https://forum.ansible.com/t/introduce-exception-in-inventory-with-all-option/30747/2 "2019-07-10T16:32:28Z")

</div>

Finally I found the option

[https://serverfault.com/questions/922172/in-ansible-how-do-i-specify-an-exclusion-set-of-hosts-in-a-playbook](https://serverfault.com/questions/922172/in-ansible-how-do-i-specify-an-exclusion-set-of-hosts-in-a-playbook)

If someone is interested 🙂

---

<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:** [July 15, 2019, 8:05pm UTC](https://forum.ansible.com/t/introduce-exception-in-inventory-with-all-option/30747/3 "2019-07-15T20:05:23Z")

</div>

it is 'host patterns', you can also

- hosts: all:!notthese

[https://docs.ansible.com/ansible/latest/user\_guide/intro\_patterns.html](https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html)
