AWX/Ansible Tower - unable to resolve Module Dependency - "No module named 'azure.cli.core.auth' "

197 views
Skip to first unread message

Alex Walker

unread,
Jun 22, 2022, 10:40:52 AM6/22/22
to AWX Project
Hi

I'm trying to install the Azure.Azcollection module on an AWX server, but encountering the following dependency error:

TASK [List all keys in specific key vault] *************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'azure.cli.core.auth'
fatal: [alma8-1]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on awx's Python /awx/venv/zts/bin/python. 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"}

The server uses a (to my knowledge) fairly standard docker based AWX setup. Within the tasks container I've installed all the dependencies in the /azcollection/requirements-azure.txt file, and also installed the Azure CLI tool separately.

I haven't specified a virtual environment pre-install, but other changes such as changing error messages have been detected post-install after adding other components, and the azcollection files have appeared within the relevant venv directory, so I'm fairly sure that installing to the wrong venv isn't a factor here.

The following modules are confirmed as present:

bash-4.4# pip3 list | grep azure | grep core
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
azure-cli-core (2.11.1)
azure-core (1.24.1)
azure-mgmt-core (1.2.0)

There doesn't seem to be a more specific module for azure-cli-core-auth, I've tried a few variations on the name.

bash-4.4# pip3 install azure-cli-core-auth
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting azure-cli-core-auth
  Could not find a version that satisfies the requirement azure-cli-core-auth (from versions: )
No matching distribution found for azure-cli-core-auth

was by contrast able to successfully install the azcollection module on a bare bones Centos 8 box previously using just the requirements file and additionally installing Azure CLI, so something is different about the AWX setup.

Software versions: python: 3.6.8, ansible: 2.9.10, awx: 13.0.0

Can anybody assist further in helping me troubleshoot this? As far as I can tell the dependency should be present, and I'm not certain where to go next with this.

Thanks.

Alex.

AWX Project

unread,
Jun 22, 2022, 3:20:40 PM6/22/22
to AWX Project
For clarification, are you having this issue in AWX 13 or in a newer version and it used to work in version 13?
If its version 13 you till need to make sure this is installed in the container that AWX is running in.
If its for a later version, we now use Execution Environments. You would need to see if that library is inside the EE you are running with. If not, you can use ansible-builder to create a new custom EE with the libraries in it.

-The AWX Team

Alex Walker

unread,
Jun 23, 2022, 2:50:28 AM6/23/22
to AWX Project
It's AWX 13, and it is installed inside the awx_task container, and It's a new install.

The other, successful install I did was just on a bare bones Centos 8/ansible box with no AWX component.

Thanks.

Alex.

AWX Project

unread,
Jun 23, 2022, 8:31:50 AM6/23/22
to AWX Project
Unfortunately, AWX 13 is getting old and we don't have a lot of support cycles for it anymore.
Did you install it into /var/lib/awx/venv/ansible? Or you are pointing to another virtual environment through the UI and assigning that to your job template?
If so, are you targeting localhost in your playbook/on your task or is this step running on the targeted node?
Have you tried using this module on a newer version of AWX?

-The AWX Team
Reply all
Reply to author
Forward
0 new messages