# Error with ansible

**URL:** <https://forum.ansible.com/t/error-with-ansible/24827>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [June 27, 2017, 9:28am UTC](https://forum.ansible.com/t/error-with-ansible/24827 "2017-06-27T09:28:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehdi\_B](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mehdi\_B](https://forum.ansible.com/u/Mehdi_B)\
**Post date:** [June 27, 2017, 9:28am UTC](https://forum.ansible.com/t/error-with-ansible/24827/1 "2017-06-27T09:28:53Z")

</div>

Hi,

Getting this error:

ansible-playbook -i inventory.azur demo.yml

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [localhost]

TASK [create ressource group] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named packaging.version  
fatal: [localhost]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_a\_XnCB/ansible\_module\_azure\_rm\_resourcegroup.py", line 107, in \n from ansible.module\_utils.azure\_rm\_common import \*\n File "/tmp/ansible\_a\_XnCB/ansible\_modlib.zip/ansible/module\_utils/azure\_rm\_common.py", line 29, in \nImportError: No module named packaging.version\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0}  
to retry, use: --limit @/root/work/azureAnsible/demo.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

localhost : ok=1 changed=0 unreachable=0 failed=1

I installed azure as required even with:

pip install azure --upgrade

and got 2.0.0 not even the RC. So on this side seems ok. Tested on 2 different servers.

My azure inventory subscription ID is ok and works fine with terraform.

My playbook mimic the doc found here:

[https://docs.ansible.com/ansible/azure\_rm\_resourcegroup\_module.html](https://docs.ansible.com/ansible/azure_rm_resourcegroup_module.html)

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [June 27, 2017, 10:18am UTC](https://forum.ansible.com/t/error-with-ansible/24827/2 "2017-06-27T10:18:16Z")

</div>

Hi, Seems something is wrong with python/ansible… For Azure you need python 2.7 as written in documentation What distribution did you use ? How did you install python ? How did you install pip ? Regards, JYL

---

<div class="post-metadata">

**Author:** ![Mehdi\_B](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mehdi\_B](https://forum.ansible.com/u/Mehdi_B)\
**Post date:** [June 27, 2017, 12:29pm UTC](https://forum.ansible.com/t/error-with-ansible/24827/3 "2017-06-27T12:29:47Z")

</div>

Hi,

Python 2.7 on centos.

Installed Ansible from epel & have 2.3.0 and installed azur using pip install azur --upgrade. The stack looks ok but this is messy over azurRM modules.

M B

---

<div class="post-metadata">

**Author:** ![Mehdi\_B](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mehdi\_B](https://forum.ansible.com/u/Mehdi_B)\
**Post date:** [June 27, 2017, 12:59pm UTC](https://forum.ansible.com/t/error-with-ansible/24827/4 "2017-06-27T12:59:33Z")

</div>

Ansible AzurRM module will only work with 2.0.0RC5 otherwise it will blow out. Seem there is a back check that don’t detect well that 2.0.0 is the release and it should work.

M B

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [June 27, 2017, 2:32pm UTC](https://forum.ansible.com/t/error-with-ansible/24827/5 "2017-06-27T14:32:08Z")

</div>

Hi,

Please provide more information so we can help !

Which version of CentOS ?  
How did you install python 2.7 ?  
How did you install pip ?  
Can you do python --version ?  
Can you do pip --version ?

Regards,

JYL

---

<div class="post-metadata">

**Author:** ![Mehdi\_B](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mehdi\_B](https://forum.ansible.com/u/Mehdi_B)\
**Post date:** [June 29, 2017, 8:32am UTC](https://forum.ansible.com/t/error-with-ansible/24827/6 "2017-06-29T08:32:16Z")

</div>

Hi,

Used: centos 7.3

Python 2.7 ( latest package)  
yum install ansible -y

from epel repo.

Pip default version from Repo. I think 8.2 ( destroyed the VM).

But as you see.my previous reply azure\_rm modules are tied with python package azure 2.0.0rc5 & wont work with 2.0.0rc6 or 2.0.0 I think there is a hard coded limit check in the module.

M B
