# ec2\_group\_module: No hosts matched

**URL:** <https://forum.ansible.com/t/ec2-group-module-no-hosts-matched/17189>\
**Category:** Ansible Project\
**Created:** [January 5, 2015, 8:45pm UTC](https://forum.ansible.com/t/ec2-group-module-no-hosts-matched/17189 "2015-01-05T20:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJ1](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@JJ1](https://forum.ansible.com/u/JJ1)\
**Post date:** [January 5, 2015, 8:45pm UTC](https://forum.ansible.com/t/ec2-group-module-no-hosts-matched/17189/1 "2015-01-05T20:45:31Z")

</div>

Hi,

I’m trying to run the sample as given [here](http://docs.ansible.com/ec2_group_module.html). I copied and pasted the yml file. Though when I run I receive “No hosts matched”.

Any ideas?

Thanks,  
Josh

---

<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 7, 2015, 1:09pm UTC](https://forum.ansible.com/t/ec2-group-module-no-hosts-matched/17189/2 "2015-01-07T13:09:10Z")

</div>

that example is not a complete playbook, just a task, try adding this on top:

- hosts: localhost  
&nbsp;&nbsp;gather\_facts: false  
&nbsp;&nbsp;connection: local  
&nbsp;&nbsp;tasks:

\< put example here indented so it is under tasks:
