Hi,
I find it impossible to find good guides on how to switch to ansible 2.10 and use galaxy collections.
SUMMARY
Installed Ansible 2.10 and collection azure.azurecollection. I am unable to get Ansible 2.10 working with collections for my existing playbooks.
COMPONENT NAME
azure_rm_virtualmachine_info
ANSIBLE VERSION2.10.2
STEPS TO REPRODUCE
- hosts: localhost gather_facts: no collections: - azure.azcollection
ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named ‘azure.mgmt.monitor.version’ fatal: [127.0.0.1]: FAILED! => {“changed”: false, “msg”: “Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on ansible-test’s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter”}
You should always take a look at the requirements for each module in collection:
https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_virtualmachine_info_module.html
The error is refering to missing python module.
Have you installed azure sdk for python version 2.0 or higher??
Run:
pip list
See if azure is on the list.
If not, try and run:
pip install azure
If that doesn’t help, let me know.
Dana srijeda, 7. listopada 2020. u 13:09:37 UTC+2 korisnik nbmp...@gmail.com napisao je:
Hi,
Thanks. The Azure SDK is no longer available.
sudo pip3 install azure
[sudo] password for nbm:
Collecting azure
Using cached azure-5.0.0.zip (4.6 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-0sq87aw5/azure/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-0sq87aw5/azure/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ egg_info --egg-base /tmp/pip-install-0sq87aw5/azure/pip-egg-info
cwd: /tmp/pip-install-0sq87aw5/azure/
Complete output (24 lines):
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-0sq87aw5/azure/setup.py”, line 60, in
raise RuntimeError(message)
RuntimeError:
Starting with v5.0.0, the ‘azure’ meta-package is deprecated and cannot be installed anymore.
Please install the service specific packages prefixed by azure
needed for your application.
The complete list of available packages can be found at:
https://aka.ms/azsdk/python/all
Here’s a non-exhaustive list of common packages:
A more comprehensive discussion of the rationale for this decision can be found in the following issue:
https://github.com/Azure/azure-sdk-for-python/issues/10646
Hey
Sorry for the late response, I was unable to check the group for a while.
The azure sdk version does not need to be latest. It’s enough for it to be higher than version 2.0.
If the meta package became depricated with version 5.0, you can always install the latest before that.
Try this:
sudo pip3 install ‘azure<5.0’
Let me know if you encounter any furhter issues.
Dana petak, 9. listopada 2020. u 10:18:26 UTC+2 korisnik nbmp...@gmail.com napisao je:
I also tried that and didnt work :-/ posting this bug in ansible will close right away. so not upgrading
ons. 14. okt. 2020 kl. 13.59 skrev Hrvoje Gašpar <moonchild.trooper@gmail.com>: