# Need help with adding multiple hosts

**URL:** <https://forum.ansible.com/t/need-help-with-adding-multiple-hosts/21482>\
**Category:** Ansible Project\
**Created:** [May 18, 2016, 5:48pm UTC](https://forum.ansible.com/t/need-help-with-adding-multiple-hosts/21482 "2016-05-18T17:48:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_S1](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Eric\_S1](https://forum.ansible.com/u/Eric_S1)\
**Post date:** [May 18, 2016, 5:48pm UTC](https://forum.ansible.com/t/need-help-with-adding-multiple-hosts/21482/1 "2016-05-18T17:48:43Z")

</div>

I’m trying to figure out why this is only adding one hosts after registering ec2  
Ansible 2.0.2

- name: Add hosts group temporary inventory group  
add\_host: name={{ item.private\_ip }} groups=dynamic  
with\_items: “{{ ec2.instances }}”
