# Ansible Dynamic Inventory for Azure does not work on Ubuntu 16.04 Agent

**URL:** <https://forum.ansible.com/t/ansible-dynamic-inventory-for-azure-does-not-work-on-ubuntu-16-04-agent/29783>\
**Category:** Ansible Project\
**Tags:** azure, ubuntu\
**Created:** [February 27, 2019, 2:49am UTC](https://forum.ansible.com/t/ansible-dynamic-inventory-for-azure-does-not-work-on-ubuntu-16-04-agent/29783 "2019-02-27T02:49:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ameya\_Agashe](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@Ameya\_Agashe](https://forum.ansible.com/u/Ameya_Agashe)\
**Post date:** [February 27, 2019, 2:49am UTC](https://forum.ansible.com/t/ansible-dynamic-inventory-for-azure-does-not-work-on-ubuntu-16-04-agent/29783/1 "2019-02-27T02:49:21Z")

</div>

Hi Guys,

I’m getting the below error when I try to run Ansible Dynamic inventory on Ubuntu 16.04, the source of python script is here:

wget [https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/azure\_rm.py](https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/azure_rm.py)

##[debug]cmdToRun = ansible-playbook -i /home/vsts/work/r1/a/\_IaaC-Build/drop/scripts/azure\_rm.py /home/vsts/work/r1/a/\_IaaC-Build/drop/playbooks/common.yml ERROR! The file /home/vsts/work/r1/a/\_IaaC-Build/drop/scripts/azure\_rm.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with `chmod -x /home/vsts/work/r1/a/_IaaC-Build/drop/scripts/azure_rm.py`. ERROR! Inventory script (/home/vsts/work/r1/a/\_IaaC-Build/drop/scripts/azure\_rm.py) had an execution error: Traceback (most recent call last): File “/home/vsts/work/r1/a/\_IaaC-Build/drop/scripts/azure\_rm.py”, line 212, in import ansible.module\_utils.six.moves.urllib.parse as urlparse ImportError: No module named six.moves.urllib.parse ERROR! /home/vsts/work/r1/a/\_IaaC-Build/drop/scripts/azure\_rm.py:22: Error parsing host definition ‘’‘’': No closing quotation

The agent is Ubuntu 16.04 machine

Appreciate any guidance.

Thank you.

Kind Regards

Ameya Agashe
