-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
name 'client_secret' is not defined #771
Comments
Thanks to this answer in a stackoverflow post (https://stackoverflow.com/a/71266343), I found the solution. |
A solution that worked for us without pinning old versions of dependencies was to add client_secret in https://github.com/ansible-collections/azure/blob/dev/plugins/inventory/azure_rm.py#L229: def _credential_setup(self):
auth_options = dict(
...
client_secret=self.get_option('secret'),
...
) This seems to be related to an upstream change in the auth library, where they now expect Unfortunately, we run a fairly heavily modified version from what's in this repo, so I don't have a great way to submit and test a patch here, but I figured I'd drop this note in case it's of help! |
I don't understand why this has been closed. @xuzhang3 @Fred-sun Could the fix proposed by @ChandlerSwift be added to |
@fredflev how do you install the install the collection dependencies? |
Hi, I use pip and install the My ansible==6.1.0
ansible-lint==5.3.2
azure-cli
azure-common
molecule>=3.5
molecule-docker
msrestazure As mentioned, installing
I think one of the issue here is that I install the latest version of And the requirements of https://github.com/ansible-collections/azure/blob/v1.13.0/requirements-azure.txt So the "old" packages used by So if I then try to install the actual pip3 install -r /usr/local/lib/python3.9/site-packages/ansible_collections/azure/azcollection/requirement.txt It will downgrade most of the dependencies I need for And obviously running the command above makes The quickest way to recover this is to uninstall all my pip packages via Things work has expected with So this works fine:
So in short the issues here is that the list of dependencies in https://github.com/ansible-collections/azure/blob/v1.13.0/requirements-azure.txt is really outdated and that The "requirements mismatch" between |
For anyone who's facing the same issue: I ended up installing Below is an example of my
The only draw back of this approach is that now I need to activate the virtualenv prior to run any ansible command but that's fine by me. pipenv shell
ansible -i my_inventory -m ping all |
@CGHoussem does this issue still exist? |
Following the thread, apparently it does still exist. I've closed the issue before since there are alternative solutions. |
@CGHoussem tried with latest release v1.13.0 , this issue has been fixed. |
@xuzhang3 Unfortunately I can no longer test the issue (I have no azure subscription); Therefore, I will take your word for it. |
I've installed azure.azcollection 1.14.0, but the error is still there:
Even when using within Details:
Stack trace:
I think it's the problem of |
WorkaroundTemporary workaround was to downgrade Azure collection to
See comparison for v1.10.0...v1.11.0 (search for For the better solution, check further analysis below. |
Ok, I've found the issue. All of below changes are in The following import of
When tested import line (as it is) manually in
then re-execute So the real error was with a different module:
I've got the confirmation from Python3 shell:
Fixed by: The same error happens with
Fixed by: And another one:
Attempt fix:
Didn't help. and next one:
Attempt fix:
Didn't help, maybe the wrong version is installed. Another:
Fixed by:
At this point, I've tried to install all
Another one missing:
WorkaroundThe universal workaround in my case was to move import of |
For quicker installing missing/broken dependencies, use the following command (change tag version if necessary):
This should potentially fix all the missing modules (unless there are some conflicts which needs to be resolved manually). Not sure why this was not installed during installation of |
Ok, it broke again after I've installed Then when I've installed
So if you need
It seems the current dependency requirements from v1.14.0 breaks dependencies of azure-cli:
So in summary if I install |
@kenorb can you try install/run the azcollection a virtual environment? |
This comment was marked as off-topic.
This comment was marked as off-topic.
any work on this? this is happening to me today with azure.azcollection 1.16 and ansible 8.1.0 and azure-cli 2.49.0 , with the auth type of 'auto', if i set it to cli it works i guess |
Any update with this issue for azure.azcollection 1.17, getting the same issue with client secret not being found |
@JLP2000 Can you share your error information? This will help solve your problem, thank you! |
@Fred-sun This is the error, a envs file is being passed where "AZURE_SECRET" is assigned but still getting the error:
|
I am facing the same issue with ubuntu20.04 , [WARNING]: Collection azure.azcollection does not support Ansible version 2.12.3
|
root@bad2e417f11a:/etc/ansible/inventory# ansible-galaxy collection list /root/.ansible/collections/ansible_collectionsCollection Version azure.azcollection 2.1.1 |
@kenorb @CGHoussem @sloharadmin azure.azcollection upgrades its credentials from trunck1 SDK to trunck2 SDK through the azure-identity file, so if you are upgrading to the new version, you need to install azure-identity. Link (https://github.com/ansible-collections/azure)specifies that all dependencies need to be installed! Thank you!
|
Any feedback? |
I will close it if you have no other question! Wellcom to contribute new when you meet new errors! Thank you very much! |
Experiencing the same error in version azure.azcollection 2.7.0... Anyone? |
@lucasscheepers can you share the errors logs? |
SUMMARY
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
My azure_rm.yml file:
my ~/.azure/credentials file:
The command that I ran:
ansible-inventory -i azure_rm.yml --list
EXPECTED RESULTS
I should have the list of my inventory since I am trying to create a dynamic one.
Keep in mind that when I set the "auth_source" to "cli", it works just fine but not when I use the other sources.
For the moment I am running this from a WSL (ubuntu) then I am going to be running this from an azure pipeline.
ACTUAL RESULTS
The output explains itself 😞 I get this warning at first:
[WARNING]: * Failed to parse /home/houssem/TestProject/azure_rm.yml with auto plugin: name 'client_secret' is not defined
The text was updated successfully, but these errors were encountered: