kitchen-azurerm 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51b127c1a7e5d1c197dde573ce77d5e9900fe2297d12e5d8cbcd4d6d1e328ccc
4
- data.tar.gz: d59c1a55f910f415a271a4818a8879a16e06dff3192d3d3a64d5ce1c32313e6c
3
+ metadata.gz: 0d0eb72851f696b3ddaeb4a90b959d4a4319fa8711cafbae1c46c0abc5506fc5
4
+ data.tar.gz: 83d0b2a2604bd3cfedba07081f96ef39ac7bcc9d5170a4cc35f97656df4c02bc
5
5
  SHA512:
6
- metadata.gz: 1e21e9a0cce3a113f9d6fd9206a9272282eb1d54c637e2c9f5b629a42ccbf144889355d18db7127a7693e088d8056005139cdf142e3232ed70870c72b23db3f0
7
- data.tar.gz: '0690d8abddf2c745c7631e463e7479299a0e1e8a83af57caca797e8555a840bc0559c383d7d703b35c7bb7ec4c65b7556a15e95cf2b4582c153f8e45d0dd97e9'
6
+ metadata.gz: 9fc4b53f648b73a6e628c942ba01e56c9a7fa5f766d11a1ea6e2de4f553fa1f89a0b1058fca4d50e3ae8b8a48ec230141c3d2f116dd086585e8f4845945f0d5a
7
+ data.tar.gz: eb5db25247d145375fcd69050eaa9fdf9cf29262a06cb54443f21e85d2836c14e0e8d424279abde2375517d6b83c5c633480d864caff92d1d87224969b15decf
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # kitchen-azurerm
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/kitchen-azurerm.svg)](http://badge.fury.io/rb/kitchen-azurerm) ![CI](https://github.com/test-kitchen/kitchen-azurerm/workflows/CI/badge.svg?branch=master)
3
+ [![Gem Version](https://badge.fury.io/rb/kitchen-azurerm.svg)](https://badge.fury.io/rb/kitchen-azurerm)
4
+ ![CI](https://github.com/test-kitchen/kitchen-azurerm/workflows/CI/badge.svg?branch=master)
4
5
 
5
6
  **kitchen-azurerm** is a driver for the popular test harness [Test Kitchen](http://kitchen.ci) that allows Microsoft Azure resources to be provisioned before testing. This driver uses the new Microsoft Azure Resource Management REST API via the [azure-sdk-for-ruby](https://github.com/azure/azure-sdk-for-ruby).
6
7
 
@@ -259,7 +260,45 @@ suites:
259
260
  attributes:
260
261
  ```
261
262
 
262
- ### .kitchen.yml example 5 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Managed Image
263
+ ### .kitchen.yml example 5 - deploy VM to existing virtual network/subnet with a Standard SKU public IP (use for ExpressRoute/VPN scenarios)
264
+
265
+ The following example introduces the ```vnet_id``` and ```subnet_id``` properties under "driver" in the configuration file. This can be applied at the top level, or per platform.
266
+ You can use this capability to create the VM on an existing virtual network and subnet created in a different resource group.
267
+
268
+ This enables scenarios that require a Standard SKU public IP resource, for example when a NAT gateway is present on the target subnet.
269
+
270
+
271
+ ```yaml
272
+ ---
273
+ driver:
274
+ name: azurerm
275
+ subscription_id: 'your-azure-subscription-id-here'
276
+ location: 'West Europe'
277
+ machine_size: 'Standard_D1'
278
+
279
+ transport:
280
+ ssh_key: ~/.ssh/id_kitchen-azurerm
281
+
282
+ provisioner:
283
+ name: chef_zero
284
+
285
+ platforms:
286
+ - name: ubuntu-1404
287
+ driver:
288
+ image_urn: Canonical:UbuntuServer:14.04.4-LTS:latest
289
+ vnet_id: /subscriptions/b6e7eee9-YOUR-GUID-HERE-03ab624df016/resourceGroups/pendrica-infrastructure/providers/Microsoft.Network/virtualNetworks/pendrica-arm-vnet
290
+ subnet_id: subnet-10.1.0
291
+ public_ip: true
292
+ public_ip_sku: Standard
293
+
294
+ suites:
295
+ - name: default
296
+ run_list:
297
+ - recipe[kitchen-azurerm-demo::default]
298
+ attributes:
299
+ ```
300
+
301
+ ### .kitchen.yml example 6 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Managed Image
263
302
 
264
303
  This example is the same as above, but uses a private managed image to provision the vm.
265
304
 
@@ -294,7 +333,7 @@ suites:
294
333
  attributes:
295
334
  ```
296
335
 
297
- ### .kitchen.yml example 6 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Classic OS Image
336
+ ### .kitchen.yml example 7 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Classic OS Image
298
337
 
299
338
  This example a classic Custom VM Image (aka a VHD file) is used. As the Image VHD must be in the same storage account then the disk of the instance, the os disk is created in an existing image account.
300
339
 
@@ -337,7 +376,7 @@ suites:
337
376
  attributes:
338
377
  ```
339
378
 
340
- ### .kitchen.yml example 7 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Classic OS Image and providing custom data and extra large os disk
379
+ ### .kitchen.yml example 8 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Classic OS Image and providing custom data and extra large os disk
341
380
 
342
381
  This is the same as above, but uses custom data to customize the instance.
343
382
 
@@ -382,7 +421,7 @@ suites:
382
421
  attributes:
383
422
  ```
384
423
 
385
- ### .kitchen.yml example 8 - Windows 2016 VM with additional data disks
424
+ ### .kitchen.yml example 9 - Windows 2016 VM with additional data disks
386
425
 
387
426
  This example demonstrates how to add 3 additional Managed data disks to a Windows Server 2016 VM. Not supported with legacy (pre-managed disk) storage accounts.
388
427
 
@@ -419,7 +458,7 @@ suites:
419
458
  attributes:
420
459
  ```
421
460
 
422
- ### .kitchen.yml example 9 - "post-deployment" ARM template with MSI authentication
461
+ ### .kitchen.yml example 10 - "post-deployment" ARM template with MSI authentication
423
462
 
424
463
  The following example introduces the ```post_deployment_template``` and ```post_deployment_parameters``` properties in the configuration file.
425
464
  You can use this capability to execute an ARM template containing Azure resources to provision after the system under test is created.
@@ -505,7 +544,7 @@ Example postdeploy.json to enable MSI extention on VM:
505
544
  }
506
545
  ```
507
546
 
508
- ### .kitchen.yml example 10 - Enabling Managed Service Identities
547
+ ### .kitchen.yml example 11 - Enabling Managed Service Identities
509
548
 
510
549
  This example demonstrates how to enable a System Assigned Identity and User Assigned Identities on a Kitchen VM.
511
550
  Any combination of System and User assigned identities may be enabled, and multiple User Assigned Identities can be supplied.
@@ -541,7 +580,7 @@ suites:
541
580
  attributes:
542
581
  ```
543
582
 
544
- ### .kitchen.yml example 11 - deploy VM with key vault certificate
583
+ ### .kitchen.yml example 12 - deploy VM with key vault certificate
545
584
 
546
585
  This following example introduces ```secret_url```, ```vault_name```, and ```vault_resource_group``` properties under "driver" in the configuration file. You can use this capability to create a VM with a specified key vault certificate.
547
586
 
@@ -208,6 +208,10 @@ module Kitchen
208
208
  ENV["AZURE_SUBSCRIPTION_ID"]
209
209
  end
210
210
 
211
+ default_config(:public_ip_sku) do |_config|
212
+ "Basic"
213
+ end
214
+
211
215
  default_config(:azure_api_retries) do |_config|
212
216
  5
213
217
  end
@@ -238,6 +242,12 @@ module Kitchen
238
242
  deployment_parameters[:adminPassword] = config[:password]
239
243
  end
240
244
 
245
+ deployment_parameters[:publicIPSKU] = config[:public_ip_sku]
246
+
247
+ if config[:public_ip_sku] == "Standard"
248
+ deployment_parameters[:publicIPAddressType] = "Static"
249
+ end
250
+
241
251
  if config[:subscription_id].to_s == ""
242
252
  raise "A subscription_id config value was not detected and kitchen-azurerm cannot continue. Please check your kitchen.yml configuration. Exiting."
243
253
  end
@@ -40,6 +40,20 @@
40
40
  "description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
41
41
  }
42
42
  },
43
+ "publicIPSKU": {
44
+ "type": "string",
45
+ "defaultValue": "Standard",
46
+ "metadata": {
47
+ "description": "SKU name for the Public IP used to access the Virtual Machine."
48
+ }
49
+ },
50
+ "publicIPAddressType": {
51
+ "type": "string",
52
+ "defaultValue": "Dynamic",
53
+ "metadata": {
54
+ "description": "SKU name for the Public IP used to access the Virtual Machine."
55
+ }
56
+ },
43
57
  <%- unless os_disk_size_gb.to_s.empty? -%>
44
58
  "osDiskSizeGb": {
45
59
  "type": "int",
@@ -201,7 +215,6 @@
201
215
  "subnetPrefix": "10.0.0.0/24",
202
216
  "storageAccountType": "[parameters('storageAccountType')]",
203
217
  "publicIPAddressName": "publicip",
204
- "publicIPAddressType": "Dynamic",
205
218
  "vmStorageAccountContainerName": "vhds",
206
219
  "vmName": "[parameters('vmName')]",
207
220
  "vmSize": "[parameters('vmSize')]",
@@ -242,12 +255,15 @@
242
255
  <%- end -%>
243
256
  <%- if public_ip -%>
244
257
  {
245
- "apiVersion": "2015-05-01-preview",
258
+ "apiVersion": "2017-08-01",
246
259
  "type": "Microsoft.Network/publicIPAddresses",
247
260
  "name": "[variables('publicIPAddressName')]",
248
261
  "location": "[variables('location')]",
262
+ "sku": {
263
+ "name": "[parameters('publicIPSKU')]"
264
+ },
249
265
  "properties": {
250
- "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
266
+ "publicIPAllocationMethod": "[parameters('publicIPAddressType')]",
251
267
  "dnsSettings": {
252
268
  "domainNameLabel": "[parameters('dnsNameForPublicIP')]"
253
269
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-azurerm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Preston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-29 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure_mgmt_network
@@ -110,90 +110,6 @@ dependencies:
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '3.0'
113
- - !ruby/object:Gem::Dependency
114
- name: rake
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: '11.0'
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: '11.0'
127
- - !ruby/object:Gem::Dependency
128
- name: chefstyle
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - '='
132
- - !ruby/object:Gem::Version
133
- version: 1.4.2
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - '='
139
- - !ruby/object:Gem::Version
140
- version: 1.4.2
141
- - !ruby/object:Gem::Dependency
142
- name: rspec
143
- requirement: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - "~>"
146
- - !ruby/object:Gem::Version
147
- version: '3.5'
148
- type: :development
149
- prerelease: false
150
- version_requirements: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - "~>"
153
- - !ruby/object:Gem::Version
154
- version: '3.5'
155
- - !ruby/object:Gem::Dependency
156
- name: rspec-mocks
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - "~>"
160
- - !ruby/object:Gem::Version
161
- version: '3.5'
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - "~>"
167
- - !ruby/object:Gem::Version
168
- version: '3.5'
169
- - !ruby/object:Gem::Dependency
170
- name: rspec-expectations
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: '3.5'
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - "~>"
181
- - !ruby/object:Gem::Version
182
- version: '3.5'
183
- - !ruby/object:Gem::Dependency
184
- name: rspec-its
185
- requirement: !ruby/object:Gem::Requirement
186
- requirements:
187
- - - "~>"
188
- - !ruby/object:Gem::Version
189
- version: 1.3.0
190
- type: :development
191
- prerelease: false
192
- version_requirements: !ruby/object:Gem::Requirement
193
- requirements:
194
- - - "~>"
195
- - !ruby/object:Gem::Version
196
- version: 1.3.0
197
113
  description: Test Kitchen driver for the Microsoft Azure Resource Manager (ARM) API
198
114
  email:
199
115
  - stuart@chef.io
@@ -220,14 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
136
  requirements:
221
137
  - - ">="
222
138
  - !ruby/object:Gem::Version
223
- version: '0'
139
+ version: '2.5'
224
140
  required_rubygems_version: !ruby/object:Gem::Requirement
225
141
  requirements:
226
142
  - - ">="
227
143
  - !ruby/object:Gem::Version
228
144
  version: '0'
229
145
  requirements: []
230
- rubygems_version: 3.1.2
146
+ rubygems_version: 3.1.4
231
147
  signing_key:
232
148
  specification_version: 4
233
149
  summary: Test Kitchen driver for Azure Resource Manager.