-
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
azure_rm_roleassignment fails on additional runs #460
Comments
@tlourey Thank you for raising this question. As the module does not support updating and idempotency, we will investigate again. Thank you very much! |
@tlourey |
I was using Azure Cloud shell but have only been trying to use that module since February. I didn't install the azure collection, but everything ran except this. Only way I could get it to run when re-running playbook was remove the IAM assignment first, each time. |
I know very little about how the cloud shell operates or what version it's using. Or how you would determine that. Hopefully @Fred-sun has a bit more knowledge of that and can comment. However what you're describing matches up with issues #145 and #266 which were fixed by PR #301 . I highly suspect that your issue will be fixed by a version update. |
Updated azcollection in Cloud shell to 1.4.0
Still getting:
|
Does the problem persist if you change to
??? It may be trying to use an older built in version instead of the fully qualified collection module. |
If it helps:
|
Just tried with this:
Same result:
|
Alright, I'll have to play around and see if I can replicate. Past my bed time so it'll have to wait till I can take a rigorous look. By your code I'm guessing you're assigning to a VM scope? |
Many thanks. Correct, a VM. I am also fairly sure it's happening outside of Azure Cloud Shell. I tried another new box using the Microsoft Ansible Quick Start Guide:
Let me know if there is anything else you need. |
Could you please provide me your whole playbook (or as much as you can provide while keeping out personal details) ? It will help me replicate the issue. |
@tlourey Do you want to recreate or update your role? Thank you very much! |
@Fred-sun its trying to create the role assignment. But when it runs a second time it sees that it already exists and errors, instead of just skipping |
@paultaiton https://gist.github.com/tlourey/049ab639f018307301bd7809ac9de5c3. I think I've stripped it out safely. |
Thanks. I'll take a look first chance I get. |
@tlourey
|
@paultaiton you are correct. That did resolve the issue. I'm testing a third time to be safe, but it seems to continue normally now. |
@paultaiton this still seems to happen?
where
I'm running Appreciate any guidance |
@Mohammad-Atif-Khan Based on what I remember, and what you've copied, this shouldn't be possible, but we'll see. Also, I would highly recommend you open a new "issue" for this, and tag me in it so I can see. There have been 10 minor releases between when tlourey reported the original issue and the version you're using, so they're pretty far disconnected, even if similar error message. |
SUMMARY
When using azure_rm_roleassignment in a playbook, if the role assignment already exists it returns an error and stops, instead of just continuing like all other modules.
ISSUE TYPE
COMPONENT NAME
azure_rm_roleassignment
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Azure Cloud Shell
user@Azure:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Cbld
Description: Common Base Linux Delridge (quinault)
Release: 10
Codename: quinault
STEPS TO REPRODUCE
Create playbook that uses azure_rm_roleassignment
Run playbook
Run playbook again
EXPECTED RESULTS
Doesn't error on additional runs
ACTUAL RESULTS
Errors saying role assignment already exists
The text was updated successfully, but these errors were encountered: