# Expected number of hosts

**URL:** <https://forum.ansible.com/t/expected-number-of-hosts/17391>\
**Category:** Ansible Project\
**Created:** [January 28, 2015, 8:27am UTC](https://forum.ansible.com/t/expected-number-of-hosts/17391 "2015-01-28T08:27:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vaclav\_Adamec](https://avatars.discourse-cdn.com/v4/letter/v/a6a055/32.png) [@Vaclav\_Adamec](https://forum.ansible.com/u/Vaclav_Adamec)\
**Post date:** [January 28, 2015, 8:27am UTC](https://forum.ansible.com/t/expected-number-of-hosts/17391/1 "2015-01-28T08:27:29Z")

</div>

Hi,  
is there any option to set validation of host count ? For example if we limit playbook to be run only on servers with specific fact but some servers not populate redis cache with up2date version of facts (or failed) I need to be sure that this issue will be catched before run.

I really appreciate any help you can provide

Vasek

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 28, 2015, 1:38pm UTC](https://forum.ansible.com/t/expected-number-of-hosts/17391/2 "2015-01-28T13:38:59Z")

</div>

I think you want the --list-hosts command linen option, but inside the  
play you can check the length of the play\_hosts variable

---

<div class="post-metadata">

**Author:** ![Vaclav\_Adamec](https://avatars.discourse-cdn.com/v4/letter/v/a6a055/32.png) [@Vaclav\_Adamec](https://forum.ansible.com/u/Vaclav_Adamec)\
**Post date:** [January 30, 2015, 6:29am UTC](https://forum.ansible.com/t/expected-number-of-hosts/17391/3 "2015-01-30T06:29:40Z")

</div>

Thanks a lot, play\_hosts var is what I was looking for

Vasek

Dne středa 28. ledna 2015 14:39:02 UTC+1 Brian Coca napsal(a):
