Strange error: Do you have azure>=2.0.0 installed? Try `pip install ansible[azure]`- No module named containerservice

Hello,
I am puzzled from the under subject error message.

I have a very simple playbook that creates an Azure Resource Group. However, when I execute it it generates this error message.

Of course, I have the latest packages installed:

rpm -qa | grep -i ansible
ansible-2.7.8-1.fc28.noarch

rpm -qa | grep -i azure
python2-azure-sdk-2.0.0-2.fc28.noarch
python2-azure-storage-0.36.0-2.fc28.noarch
python2-msrestazure-0.4.21-2.fc28.noarch
azure-cli-2.0.60-1.el7.x86_64

Also, the containerservice is in place:

sudo find / | grep “azure” | grep -i containerservice
/usr/lib/python2.7/site-packages/azure/mgmt/compute/containerservice
/usr/lib/python2.7/site-packages/azure/mgmt/compute/containerservice/models.pyc

In the github similar errors resulted to an issue with packages versions and issues with AWX/Tower, but I don’t run it in AWX.

Any ideas?

Have you tried to follow official ansible for azure installation
guide? AFAIR it is:

pip install ansible[azure]

On MacOSX I noticed that ansible is very dependent on the right
version of Azure libraries.

Wawrzek

Using pip in a virtualenv works but not perfectly fine. I had issues with other tasks/plays that are quite strange but that’s another story.

I noticed that the packages between the rpm and the pip are exactly the same. I even did and md5sum on the containerservice and I found no diffs.

Personally I don’t like pip. pip is not a system utility.

Τη Δευτέρα, 11 Μαρτίου 2019 - 5:21:37 μ.μ. UTC+2, ο χρήστης Wawrzek Niewodniczanski έγραψε: