# Ansible error when running for multiple hosts in inventory file

**URL:** <https://forum.ansible.com/t/ansible-error-when-running-for-multiple-hosts-in-inventory-file/31908>\
**Category:** Ansible Project\
**Created:** [January 6, 2020, 1:22pm UTC](https://forum.ansible.com/t/ansible-error-when-running-for-multiple-hosts-in-inventory-file/31908 "2020-01-06T13:22:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yehuda\_Pinhas](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@Yehuda\_Pinhas](https://forum.ansible.com/u/Yehuda_Pinhas)\
**Post date:** [January 6, 2020, 1:22pm UTC](https://forum.ansible.com/t/ansible-error-when-running-for-multiple-hosts-in-inventory-file/31908/1 "2020-01-06T13:22:37Z")

</div>

Hi guys!

Inventory POC\_ENV.yml file:

all:  
children:  
POC\_ENV:  
hosts:  
TEST-NXOS2  
TEST-NXOS3  
vars:  
ansible\_ssh\_private\_key\_file: /home/ansible/.ssh/id\_rsa  
ansible\_ssh\_common\_args: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  
ansible\_user: ansible

Playbook new\_vlan\_playbook.yml file:

> **(attachments)**
>
> ![ansible ping proof.PNG](https://us1.discourse-cdn.com/ansible/original/2X/4/4452d6a165922f0e4af49b1521f92d826e58a551.png)  
> ![ansible ping proof.PNG](https://us1.discourse-cdn.com/ansible/original/2X/0/05400f680acab8cc5b5e0bebd4b353960aa763d1.png)

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [January 6, 2020, 4:28pm UTC](https://forum.ansible.com/t/ansible-error-when-running-for-multiple-hosts-in-inventory-file/31908/2 "2020-01-06T16:28:56Z")

</div>

Colon ':' is missing after the hostnames. Fix the inventory

&nbsp;&nbsp;all:  
&nbsp;&nbsp;&nbsp;&nbsp;children:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POC\_ENV:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hosts:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEST-NXOS2:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEST-NXOS3:

Without the colons the lines are concatenated. This is the reason of the error

&nbsp;&nbsp;'fatal: [TEST-NXOS2 TEST-NXOS3]: FAILED! ...'

HTH,

&nbsp;&nbsp;-vlado

---

<div class="post-metadata">

**Author:** ![Yehuda\_Pinhas](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@Yehuda\_Pinhas](https://forum.ansible.com/u/Yehuda_Pinhas)\
**Post date:** [January 7, 2020, 7:55am UTC](https://forum.ansible.com/t/ansible-error-when-running-for-multiple-hosts-in-inventory-file/31908/3 "2020-01-07T07:55:30Z")

</div>

Hi Vladimir,  
Thank you! working now.

בתאריך יום שני, 6 בינואר 2020 בשעה 18:29:10 UTC+2, מאת Vladimir Botka:
