# Loop functionality is failing when i use add\_host module inventory in other playbook

**URL:** <https://forum.ansible.com/t/loop-functionality-is-failing-when-i-use-add-host-module-inventory-in-other-playbook/32715>\
**Category:** Ansible Project\
**Created:** [April 17, 2020, 2:06pm UTC](https://forum.ansible.com/t/loop-functionality-is-failing-when-i-use-add-host-module-inventory-in-other-playbook/32715 "2020-04-17T14:06:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_Karpurapu](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Suresh\_Karpurapu](https://forum.ansible.com/u/Suresh_Karpurapu)\
**Post date:** [April 17, 2020, 2:06pm UTC](https://forum.ansible.com/t/loop-functionality-is-failing-when-i-use-add-host-module-inventory-in-other-playbook/32715/1 "2020-04-17T14:06:37Z")

</div>

Hi Ansible team,

I am using the CSV file as below for nfs volume migration as we have 1000 servers with 100 volumes. Hence, i would like to make to host inventory using add\_host file instead using inventory file. However, the loop is failing when i use add\_host module, if the server has more than one volume . would anyone please help me on this request as i would like to mount all the volumes on respective servers as per CSV input?

# cat mounts.csv

host,remote\_path,mnt\_path,python  
host1,nfsflr01:/volahcstg\_www\_masup\_stg\_data\_01,/myasup/stg/data,/usr/bin/python2.6  
host1,nfsflr02:/volahcstg\_www\_masup\_stg\_app\_01,/myasup/stg/app,/usr/bin/python2.6  
host2,nfsflr01:/volahcstg\_www\_masup\_stg\_data\_01,/myasup/stg/data,/usr/bin/python2.6  
host2,nfsflr02:/volahcstg\_www\_masup\_stg\_app\_01,/myasup/stg/app,/usr/bin/python2.6

# cat mounts.yml

---

<div class="post-metadata">

**Author:** ![Suresh\_Karpurapu](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Suresh\_Karpurapu](https://forum.ansible.com/u/Suresh_Karpurapu)\
**Post date:** [April 20, 2020, 12:07pm UTC](https://forum.ansible.com/t/loop-functionality-is-failing-when-i-use-add-host-module-inventory-in-other-playbook/32715/2 "2020-04-20T12:07:12Z")

</div>

I hope that it might be design of the add\_host module. Is there any ways to disable the BYPASS\_HOST\_LOOP = True parameter in add\_host module to enable the iteration or please suggest me if there any other ways to achieve my requirement

Regards,  
Suresh
