-
Notifications
You must be signed in to change notification settings - Fork 332
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_azurefirewall does not generate private ip address when creating new firewall #1750
Comments
@DII-dsward I test locally, the resource will be created successfully, and configure the corresponding 'private_id', can you try according to the following script?
|
@DII-dsward Your creation failure should be due to the fact that your subnet, public IP address and azure firewall are not in the same region. Thank you! |
I have switched from using id to name as you suggested. These deployments don't show up under the resource group deployments list, so I cannot provide any output from Azure. When this deploys and provisioning shows as failed, there is a migrate to firewall policy button. If I click through that it also fails because the firewall has a provisioning state of failed. But it does then provide an output from azure in the deployment list of the resource group showing this: {
"code": "InternalServerError",
"message": "An error occurred.",
"details": []
} Here is the playbook # 1. Create or update the public IP if none is available
- name: Create public IP if none is available
azure.azcollection.azure_rm_publicipaddress:
resource_group: "VnetRSG"
name: "PIP-AZFWUSC1-1"
location: "southcentralus"
allocation_method: "Static"
sku: "Standard"
state: "present"
register: new_public_ip
# 2. Create or update the Azure Firewall using names instead of IDs
- name: Create or update the Azure Firewall
azure.azcollection.azure_rm_azurefirewall:
resource_group: "VnetRSG"
name: "AZFWUSC1"
location: "southcentralus"
ip_configurations:
- name: "azureFirewallIpConfiguration"
public_ip_address:
name: "{{ new_public_ip.name }}"
subnet:
virtual_network_name: "FW_VNET"
name: "AzureFirewallSubnet"
state: "present"
Here is the ansible output {
"changed": true,
"id": "/subscriptions/<omitted>/resourceGroups/VnetRSG/providers/Microsoft.Network/azureFirewalls/AZFWUSC1",
"invocation": {
"module_args": {
"resource_group": "VnetRSG",
"name": "AZFWUSC1",
"location": " southcentralus \n",
"ip_configurations": [
{
"name": "azureFirewallIpConfiguration",
"public_ip_address": {
"name": "PIP-AZFWUSC1-1"
},
"subnet": {
"virtual_network_name": "FW_VNET",
"name": "AzureFirewallSubnet"
}
}
],
"state": "present",
"auth_source": "auto",
"cloud_environment": "AzureCloud",
"api_profile": "latest",
"disable_instance_discovery": false,
"append_tags": true,
"profile": null,
"subscription_id": null,
"client_id": null,
"secret": null,
"tenant": null,
"ad_user": null,
"password": null,
"cert_validation_mode": null,
"adfs_authority_url": null,
"log_mode": null,
"log_path": null,
"x509_certificate_path": null,
"thumbprint": null,
"tags": null,
"application_rule_collections": null,
"nat_rule_collections": null,
"network_rule_collections": null
}
},
"_ansible_no_log": false
} Should I be using azure.azcollection.azure_rm_firewallpolicy to deploy these firewalls instead? |
@DII-dsward I have not been able to simulate the error you encountered, so I am not sure whether the connection (--) solves the problem you encountered, you can refer to the following way to try, thank you!
|
Adding the user defined route in the screenshot below doesn’t help unfortunately. I can deploy this azure firewall manually via the azure marketplace just fine. Ansible’s account has the same rights I do but fails every time. The manual deployment takes 10 minutes. The ansible deployment completes in less than 2 minutes. I will go ahead and open a support ticket and reference this github issue.
|
SUMMARY
New Azure Firewall deployment with Ansible does not generate a private Ip address and provisioning state shows as failed.
ISSUE TYPE
COMPONENT NAME
azure.azcollection.azure_rm_azurefirewall
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
From AAP
EXPECTED RESULTS
Azure firewall should use an Ip on the AzureFirewallSubnet Ip range and provisioning should reflect succeeded.
ACTUAL RESULTS
Azure firewall does deploy but it does not have a private Ip address and the provisioning state shows as failed. Azure vnet shows the firewall object without a private Ip address as well.
The text was updated successfully, but these errors were encountered: