-
Notifications
You must be signed in to change notification settings - Fork 334
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
Ansible azure_rm_deployment module returns error but deployment in Azure was successful #969
Comments
@mlacko64 Thank you for following Ansible! Two nics are created in your template, but only one of your parameters is defined, so the second NIC is not created. "He led to the error Resource 'Microsoft.Net work/networkInterfaces/nicname2' under the Resource group 'testrg' was not found." Thanks! |
@Fred-sun Problem is that when you run it from portal or az cli, template ends with success. When I run it using ansible, it ends with failure (but there is no failure at all visible in azure for that deployment). And I believe there should be no error reported, because only one NIC should be deployed based on inputs. So in short, I believe that returned error is a bug. Moreover, this is somehow related just to NICs, I tried something similar with storage account (simple condition, where just one of two is deployed) and there was no problem at all. |
@mlacko64 Ansible is deployed through the API interface. There are two nics in the template, but you only configure one, which is not reasonable? |
@mlacko64 Alternatively, you can simply delete line 101 from the template, and the deployment will create a network interface, which is successfully created. Thank you very much! |
@Fred-sun I would say either module is doing some "over work" and verifing if all nics were deployed, but ignoring fact there can be condition for deployment in ARM template. |
@mlacko64 Ansible calls the API interface to complete the deployment and returns the result. The deployment task is done by the Service according to the template. The error is caused by an incorrect template. Azure Portal/AZ CLI does not report errors, what is the relevance of this module? |
Hello, { |
@mlacko64 Is your template exactly the same as above? Or can you provide your template? Thank you very much! |
yes, I used same template as is mentioned in this conversation at top |
Two nics? |
yes, two nics , only one will be deployed based on input parameter , like mentioned in "STEPS TO REPRODUCE" section |
@mlacko64 It doesn't make sense that the VM in the template will have two nics attached, but only one will be created here and one will be attached. So the template should look something like this?
Change to
|
Essential goal of that template is that it allows user to choose between two nics based on parameter input. If there will be dependency only on first NIC and user provides input parameter "second", then deployment of NIC and VM will start in parallel which will result in failure. I still do not think problem is template as it is valid for Azure. |
fixes by #986 |
SUMMARY
Ansible azure_rm_deployment module returns error but deployment in Azure was successful.
When deploying this ARM template via az cli or Azure portal, it ends successfully. No errors.
When deploying using azure_rm_deployment, it deploys resources, no error in deployments in Azure portal. But task itself has failed.
Seems somehow related to conditions in ARM template, but it appears only when I used NICs. Tried with storage account resources, but did not occured.
ISSUE TYPE
COMPONENT NAME
azure_rm_deployment
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Red Hat Enterprise Linux release 9.0 (Plow)
STEPS TO REPRODUCE
EXPECTED RESULTS
task should return success
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: