Collection's requirements-azure.txt packages refer to conflicting versions for cli authentication with azure-cli #1138
Labels
dependencies
Pull requests that update a dependency file
medium_priority
Medium priority
work in
In trying to solve, or in working with contributors
SUMMARY
The
az
command does not get installed by the collection, therefore we need to install theazure-cli
package. However, the packages installed by the collection'srequirements-azure.txt
file conflict with recent versions of the packageazure-cli
, including2.34.0
and2.46.0
.We are trying to stick to using the
cli
auth source, hence our need for theaz
command in order to runaz login
.If possible, please review the following:
cli
-based authentication still considered a viable method by which to use this collection?cli
-based authentication for this collection?ISSUE TYPE
COMPONENT NAME
plugins/module_utils/azure_rm_common.py
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
pacman -Syu --noconfirm && reboot
)STEPS TO REPRODUCE
venv
(usually found aspython3-venv
)python3 -m venv test_dir
test_dir
, then activate the virtual environment:source bin/activate
pip
to the latest version:pip install --upgrade pip
requirements.txt
file with the following contents (requirements for our project):$PATH
with the newly install binaries:deactivate && source bin/activate
requirements.txt
file:pip install -r requirements.txt
requirements.yml
file with the following contents (collection requirements for our project):pip install -r lib/python3.10/site-packages/ansible_collection/azure/azcollection/requirements-azure.txt
az
command in$PATH
:which az
azure-cli
package (affected versions include at least2.34.0
and2.46.0
):pip install "azure-cli==2.34.0"
az login
az account set -s <subscription_id>
az network lb list
azure_rm
inventory plugin namedtest_config.azure_rm.yml
:_info
module from the collection:ansible localhost -i test_config.azure_rm.yml -m azure.azcollection.azure_rm_loadbalancer_info
ansible-inventory -i test_config.azure_rm.yml --list
EXPECTED RESULTS
I expect the module to return a list of resources specified by the module. In this case, a list of load balancers and their configuration information in a JSON-encoded format.
ACTUAL RESULTS
The module fails to import a class from
azure.mgmt.recoveryservicesbackup
because this class has been moved to a new namespace in the Azure SDK for Python. Based on steps above, version5.2.0
is installed for packageazure-mgmt-recoveryservicesbackup
. In this version, theRecoveryServicesBackupClient
class has been moved to the namespaceazure.mgmt.recoveryservicesbackup.activestamp
. See: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/__init__.py.Note that several other modules are affected in the same way, such as
azure.azcollection.azure_rm_publicipaddress_info
.See below for the error message produced by Ansible:
The text was updated successfully, but these errors were encountered: