Closed mvdpoel closed 5 years ago
@mvdpoel I have try to create storage account to verify idempotent on ansbile(2.6.0 and 2.6.3) all get successfully result, could you share your ansible verison and upgrade ansible to try again( Upgrade ansible to new: sudo pip install ansible[azure] --upgrade -I ). Thanks!
my test result:
fred@fred-Virtual-Machine:~/task/125$ ansible-playbook 125.yml
PLAY [create stoage account] ***************************************************
TASK [Gathering Facts] *********************************************************
ok: [127.0.0.1]
TASK [Ensure storage account exist] ********************************************
changed: [127.0.0.1]
PLAY RECAP *********************************************************************
127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0
fred@fred-Virtual-Machine:~/task/125$ ansible-playbook 125.yml
PLAY [create stoage account] ***************************************************
TASK [Gathering Facts] *********************************************************
ok: [127.0.0.1]
TASK [Ensure storage account exist] ********************************************
ok: [127.0.0.1]
PLAY RECAP *********************************************************************
127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0
In order for the community to handle your issue effectively, You can description of the issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md. Thanks
@mvdpoel Do you have try again? Could you help share your test result? Thanks!
@mvdpoel Thanks for the contribution, It seem not a bug, just name already exist or use old ansible version. Could you help share you test result or some detail info?
@mvdpoel Thanks for the contribution, Could you help recheck this issue? it seem not a bug, just the storage account name has already exist. Thanks!
@Fred-sun Have you ever verified the preview role?
@mvdpoel Thanks for the contribution. I have retested again. this module has idempotent. if the storage account has exist, will get this error. I think your account name may has been created by other credential or this account name has existed on other resource group. Thanks!.
@mvdpoel Thanks for the contribution, Could you help retry and share you test result to us? Thanks!
@mvdpoel thanks for the contribution. Are you still here? do you still have this question? Thanks!
@mvdpoel thanks for the contribution. Are you still here? Could we can close this issue? Thanks!
@yuwzho @yungezz The issue has no update more than one month, I have tested, this is not a bug, Could we can close this issue? Thanks!
@mvdpoel Thanks for you contribution, Are you still here? Could we can close this issue( not a bug)? Thanks!
@yungezz Could you help check this issue? this may not a bug, just the storageaccount name already in resource. Thanks!
@mvdpoel could you pls share ansible version? the issue doesn't exist in latest ansible 2.7. could you pls try against ansilbe 2.7?
@yungezz Could we can close the problem? re-open it when we encounter it again, and ask contributors for more information. Thanks!
not a bug, can be closed.
close this for now. verified azure_rm_storageaccount module idempotent works. pls open new issue if met this again with playbook snippets and repo steps. thanks.
To anybody arriving here via Google, looking for an answer: As the documentation states, storage account names have to be unique across all of Azure.
There are most likely more elegant ways to solve this, but here's what I did:
azure_k8s_cluster_sa_name: "{{ 'mystorage' | to_uuid | lower | replace('-', '') | truncate(24, True, '') }}"
obviously you need to change 'mystorage' to something else or it will fail, too.
Hi,
Trying to run this module but it's not idempotent. It keeps returning:
"The storage account named xxx is already taken. - Reason.already_exists"
Returns:
TASK [az_create_storage_account : Ensure Storage Account Exists] ***** task path: /opt/ansible/roles/ansible_role_az_create_storage_account/tasks/main.yml:2 fatal: [localhost]: FAILED! => {"changed": false, "msg": "The storage account named xxx is already taken. - Reason.already_exists"}