diff --git a/lib/kitchen/driver/azurerm.rb b/lib/kitchen/driver/azurerm.rb index 738ed7e..b462ee2 100644 --- a/lib/kitchen/driver/azurerm.rb +++ b/lib/kitchen/driver/azurerm.rb @@ -220,9 +220,7 @@ class Azurerm < Kitchen::Driver::Base false end - default_config(:zone) do |_config| - "1" - end + default_config(:zone), nil def create(state) state = validate_state(state) diff --git a/spec/unit/kitchen/driver/azurerm_spec.rb b/spec/unit/kitchen/driver/azurerm_spec.rb index d8659ab..744ab94 100644 --- a/spec/unit/kitchen/driver/azurerm_spec.rb +++ b/spec/unit/kitchen/driver/azurerm_spec.rb @@ -107,8 +107,8 @@ expect(default_config[:public_ip_sku]).to eq("Basic") end - it "Should use 1 availability zone" do - expect(default_config[:zone]).to eq("1") + it "should set zone to nil" do + expect(default_config[:zone]).to eq(nil) end it "should set store_deployment_credentials_in_state to true" do diff --git a/templates/internal.erb b/templates/internal.erb index ac585f4..0119665 100644 --- a/templates/internal.erb +++ b/templates/internal.erb @@ -8,18 +8,6 @@ "description": "The location where the resources will be created." } }, - "zone": { - "type": "string", - "defaultValue": "1", - "allowedValues": [ - "1", - "2", - "3" - ], - "metadata": { - "description": "Zone number for the virtual machine" - } - }, "vmSize": { "type": "string", "metadata": { @@ -220,7 +208,9 @@ }, "variables": { "location": "[parameters('location')]", - "zone": "[parameters('zone')]", + <% unless zone.nil? %> + "zone": "<%= zone -%>", + <% end %> "OSDiskName": "osdisk", "nicName": "[parameters('nicName')]", "addressPrefix": "10.0.0.0/16", @@ -272,9 +262,11 @@ "type": "Microsoft.Network/publicIPAddresses", "name": "[variables('publicIPAddressName')]", "location": "[variables('location')]", + <% unless zone.nil? %> "zones": [ - "[variables('zone')]" + "<%= zone -%>" ], + <% end %> "sku": { "name": "[parameters('publicIPSKU')]" }, @@ -326,9 +318,11 @@ "type": "Microsoft.Compute/virtualMachines", "name": "[variables('vmName')]", "location": "[variables('location')]", + <% unless zone.nil? %> "zones": [ - "[variables('zone')]" + "<%= zone -%>" ], + <% end %> "dependsOn": [ <%- unless use_managed_disks -%> <%- if existing_storage_account_blob_url.empty? -%>