# Ansible1.9.4 on vagrant returning an error when using dynamic inventory script.

**URL:** <https://forum.ansible.com/t/ansible1-9-4-on-vagrant-returning-an-error-when-using-dynamic-inventory-script/20654>\
**Category:** Ansible Project\
**Created:** [February 23, 2016, 2:57am UTC](https://forum.ansible.com/t/ansible1-9-4-on-vagrant-returning-an-error-when-using-dynamic-inventory-script/20654 "2016-02-23T02:57:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olu\_Oyedipe](https://avatars.discourse-cdn.com/v4/letter/o/ecd19e/32.png) [@Olu\_Oyedipe](https://forum.ansible.com/u/Olu_Oyedipe)\
**Post date:** [February 23, 2016, 2:57am UTC](https://forum.ansible.com/t/ansible1-9-4-on-vagrant-returning-an-error-when-using-dynamic-inventory-script/20654/1 "2016-02-23T02:57:01Z")

</div>

Hello,  
I’m getting the following error when running ansible on a vagrant vm:

[vagrant@localhost vagrant]$ sudo ansible all -i /vagrant/genhosts.py -m ping  
ERROR: problem running /vagrant/genhosts.py --list ([Errno 2] No such file or directory)

I wrote the dynamic inventory script and it shows up when i do an ls on the current directory:

[vagrant@localhost vagrant]$ ls -ltr genhosts.py  
-rwxrwxrwx. 1 vagrant vagrant 2260 Feb 23 02:21 genhosts.py

I also enabled ansible logging, but it doesn’t show any more information:

2016-02-23 02:54:07,837 p=20865 u=root |  
2016-02-23 02:54:07,839 p=20865 u=root | /bin/ansible all -i /vagrant/genhosts.py -m ping  
2016-02-23 02:54:07,839 p=20865 u=root |  
2016-02-23 02:54:07,852 p=20865 u=root | ERROR: problem running /vagrant/genhosts.py --list ([Errno 2] No such file or directory)

Any ideas as to why this is happening?

---

<div class="post-metadata">

**Author:** ![Olu\_Oyedipe](https://avatars.discourse-cdn.com/v4/letter/o/ecd19e/32.png) [@Olu\_Oyedipe](https://forum.ansible.com/u/Olu_Oyedipe)\
**Post date:** [February 23, 2016, 7:17pm UTC](https://forum.ansible.com/t/ansible1-9-4-on-vagrant-returning-an-error-when-using-dynamic-inventory-script/20654/2 "2016-02-23T19:17:07Z")

</div>

Found the problem. Had to change the line breaks from windows to unix style.
