Error with ansible

396 views
Skip to first unread message

Mehdi B

unread,
Jun 27, 2017, 5:28:53 AM6/27/17
to Ansible Project
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 <module>\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 <module>\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

---

- hosts: localhost
connection: local
tasks:
- name: create ressource group
azure_rm_resourcegroup:
name: testing
location: westus

So any tips ? I knowledge this is not a core module.

Thanks 


Jean-Yves LENHOF

unread,
Jun 27, 2017, 6:18:35 AM6/27/17
to ansible...@googlegroups.com
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 ?

https://github.com/ansible/ansible/issues/24275

Regards,

JYL

Mehdi B

unread,
Jun 27, 2017, 8:29:48 AM6/27/17
to Ansible Project
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

Mehdi B

unread,
Jun 27, 2017, 8:59:33 AM6/27/17
to Ansible Project
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

On Tuesday, June 27, 2017 at 12:18:35 PM UTC+2, Jean-Yves LENHOF wrote:

Jean-Yves LENHOF

unread,
Jun 27, 2017, 10:32:26 AM6/27/17
to ansible...@googlegroups.com


Le 27/06/2017 à 14:29, Mehdi B a écrit :
> 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
>
> On Tuesday, June 27, 2017 at 12:18:35 PM UTC+2, Jean-Yves LENHOF wrote:

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

Mehdi B

unread,
Jun 29, 2017, 4:32:16 AM6/29/17
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages