kitchen-azurerm 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +284 -105
- data/templates/internal.erb +4 -6
- data/templates/public.erb +27 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04287eb76a3ad593e18ca9036eee9bdb72dc6a6d67b32c2153cb9e58f862d4bc'
|
4
|
+
data.tar.gz: 8f2ea6bb99fd8b92522d304f0bcc8d7db5034edcf79bc8862ca9dbc67d188920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2f3c2f34b45368047be1397af798d77e1f0e8b6f58cc6121e4c250576b6be12d4166750ce8c08538d869576c142cd97eb99d2af9b185b21826065a0bc57a1e4
|
7
|
+
data.tar.gz: 519455de670f654930edafd819cc628f0de5ca069c97b8fe5dd750b50d9a3d771dd2db2f0260f1dc1e2e29e7e4fd307d802f71f2c28276a5d7bcc314da1c5cc3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# kitchen-azurerm
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/kitchen-azurerm.svg)](https://badge.fury.io/rb/kitchen-azurerm)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/kitchen-azurerm.svg)](https://badge.fury.io/rb/kitchen-azurerm)
|
4
4
|
![CI](https://github.com/test-kitchen/kitchen-azurerm/workflows/CI/badge.svg?branch=master)
|
5
5
|
|
6
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).
|
@@ -77,9 +77,276 @@ wsus-windows-2019 Azurerm ChefZero Inspec Winrm <Not Created> <N
|
|
77
77
|
wsus-windows-2016 Azurerm ChefZero Inspec Winrm <Not Created> <None>
|
78
78
|
```
|
79
79
|
|
80
|
-
###
|
80
|
+
### Driver Properties
|
81
81
|
|
82
|
-
|
82
|
+
The following properties are able to be specified in the `driver` section of the Test Kitchen configuration:
|
83
|
+
|
84
|
+
#### subscription_id (required)
|
85
|
+
|
86
|
+
* _string_ : Reads string from `ENV["AZURE_SUBSCRIPTION_ID"]` or must be specified if not present in `ENV`.
|
87
|
+
* Default Value: `ENV["AZURE_SUBSCRIPTION_ID"]`
|
88
|
+
|
89
|
+
#### azure_environment
|
90
|
+
|
91
|
+
* _string_ : Name of Azure environment to use.
|
92
|
+
|
93
|
+
#### machine_size (required)
|
94
|
+
|
95
|
+
* _string_ : Machine size to use for instances created.
|
96
|
+
|
97
|
+
#### location (required)
|
98
|
+
|
99
|
+
* _string_ : Azure location to use, example `"Central US"`
|
100
|
+
|
101
|
+
#### azure_resource_group_prefix
|
102
|
+
|
103
|
+
* _string_ : Prefix to use for the resource group configuration which will be created.
|
104
|
+
* Default Value: `"kitchen-"`
|
105
|
+
|
106
|
+
#### azure_resource_group_suffix
|
107
|
+
|
108
|
+
* _string_ : Optional suffix to append to resource group name.
|
109
|
+
* Default Value: `""`
|
110
|
+
|
111
|
+
#### azure_resource_group_name
|
112
|
+
|
113
|
+
* _string_ : Optional override for base name of the Azure Resource group which is created, uses prefix and suffix.
|
114
|
+
* Default Value: `""`
|
115
|
+
|
116
|
+
#### explicit_resource_group_name
|
117
|
+
|
118
|
+
* _string_ : Optional explicit resource group name, does not use `azure_resource_group_prefix`/`azure_resource_group_suffix`
|
119
|
+
* Default Value: `""`
|
120
|
+
|
121
|
+
#### destroy_explicit_resource_group
|
122
|
+
|
123
|
+
* _boolean_ : Used for cleanup with `explicit_resource_group_name`
|
124
|
+
* Default Value: `true`
|
125
|
+
|
126
|
+
#### destroy_explicit_resource_group_tags
|
127
|
+
|
128
|
+
* _boolean_ : Used for cleanup with `explicit_resource_group_name`
|
129
|
+
* Default Value: `true`
|
130
|
+
|
131
|
+
#### destroy_resource_group_contents
|
132
|
+
|
133
|
+
* _boolean_ : Can be used when you want to destroy the resources within a resource group without destroying the resource group itself. For example, the following configuration options used in combination would use an existing resource group (or create one if it doesn't exist) and will destroy the contents of the resource group in the ```kitchen destroy``` phase. If you wish to destroy the empty resource group created after you empty the resource group with this flag you can now set the ```destroy_explicit_resource_group``` to "true" to destroy the empty resource group.
|
134
|
+
* Default Value: `false`
|
135
|
+
|
136
|
+
#### resource_group_tags
|
137
|
+
|
138
|
+
* _hash_ : Optional hash of tags to pass to resource group
|
139
|
+
|
140
|
+
```yaml
|
141
|
+
driver:
|
142
|
+
name: azurerm
|
143
|
+
resource_group_tags:
|
144
|
+
tag1: tag1value
|
145
|
+
```
|
146
|
+
|
147
|
+
#### image_urn
|
148
|
+
|
149
|
+
* _string_ : Image URN to use for vm creation. List can be found using `az` cli - [https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage#list-popular-images]
|
150
|
+
* Default Value: `"Canonical:UbuntuServer:14.04.3-LTS:latest"`
|
151
|
+
|
152
|
+
#### image_url
|
153
|
+
|
154
|
+
* _string_ : (unmanaged disks only) can be used to specify a custom vhd
|
155
|
+
* This VHD must be in the same storage account as the disks of the VM, therefore ```existing_storage_account_blob_url``` must also be set and ```use_managed_disks``` must be set to false.
|
156
|
+
|
157
|
+
#### image_id
|
158
|
+
|
159
|
+
* _string_ : (managed disks only) can be used to specify an image by id (managed disk). This works only with managed disks.
|
160
|
+
|
161
|
+
#### use_ephemeral_osdisk
|
162
|
+
|
163
|
+
* _boolean_ : Optional flag to use ephermeal disk for instances.
|
164
|
+
* Default Value: `false`
|
165
|
+
|
166
|
+
#### os_disk_size_gb
|
167
|
+
|
168
|
+
* _string_ : Optional override of os disk size for instances.
|
169
|
+
|
170
|
+
#### os_type
|
171
|
+
|
172
|
+
* _string_ : Should be specified when os type is not `linux`
|
173
|
+
* Default Value: `"linux"`
|
174
|
+
|
175
|
+
#### custom_data
|
176
|
+
|
177
|
+
* _string_ : Optional custom data which may be specified for instances [https://docs.microsoft.com/en-us/azure/virtual-machines/custom-data].
|
178
|
+
* Value can be a file or the data itself, this module handles base64 encoding for you.
|
179
|
+
|
180
|
+
#### username
|
181
|
+
|
182
|
+
* _string_ : Username to use for connecting to instances.
|
183
|
+
* Default Value: `"azure"`
|
184
|
+
|
185
|
+
#### password
|
186
|
+
|
187
|
+
* _string_ : Optional password to use for connecting to instances.
|
188
|
+
* Default Value: `SecureRandom.base64(25)` (Randomly generated 24 digit password)
|
189
|
+
|
190
|
+
#### vm_name
|
191
|
+
|
192
|
+
* _string_ : Optional name for vm instances to create.
|
193
|
+
* Default Value: `"vm"`
|
194
|
+
|
195
|
+
#### nic_name
|
196
|
+
|
197
|
+
* _string_ : Optional name to provide for nic, if not specified then nic name will be `"nic-#{config[:vm_name]}"`.
|
198
|
+
|
199
|
+
#### vnet_id
|
200
|
+
|
201
|
+
* _string_ : Optional `vnet` to provide. If no `vnet` is chosen then public IP will be assigned using default values.
|
202
|
+
|
203
|
+
#### subnet_id
|
204
|
+
|
205
|
+
* _string_ : Optional subnet to provide, should be used with `vnet_id`.
|
206
|
+
|
207
|
+
#### public_ip
|
208
|
+
|
209
|
+
* _boolean_ : Option to specify if a public IP should be assigned. In default configuration if all other options are left at default then a public IP _will_ be assigned, due to `vnet_id` having no value.
|
210
|
+
* Default Value: `false`
|
211
|
+
|
212
|
+
#### public_ip_sku
|
213
|
+
|
214
|
+
* _string_ : Optional string to change the SKU of allocated public IP address. Defaults to `Basic`.
|
215
|
+
* Default Value: `"Basic"`
|
216
|
+
|
217
|
+
#### storage_account_type
|
218
|
+
|
219
|
+
* _string_ : Optional storage account type.
|
220
|
+
* Default Value: `"Standard_LRS"`
|
221
|
+
|
222
|
+
#### existing_storage_account_blob_url
|
223
|
+
|
224
|
+
* _string_ : Used with private image specification, the URL of the existing storage account (blob) (without container)
|
225
|
+
|
226
|
+
#### existing_storage_account_container
|
227
|
+
|
228
|
+
* _string_ : Used with private image specification, the Container Name for OS Images (blob)
|
229
|
+
|
230
|
+
#### boot_diagnostics_enabled
|
231
|
+
|
232
|
+
* _boolean_ : Whether to enable (true) or disable (false) boot diagnostics. Default: true (requires Standard storage).
|
233
|
+
* Default Value: `true`
|
234
|
+
|
235
|
+
#### winrm_powershell_script
|
236
|
+
|
237
|
+
* _string_ : By default on Windows machines, a PowerShell script runs that enables WinRM over the SSL transport, for Basic, Negotiate and CredSSP connections. To supply your own PowerShell script (e.g. to enable HTTP), use the `winrm_powershell_script` parameter. Windows 2008 R2 example:
|
238
|
+
|
239
|
+
```yaml
|
240
|
+
platforms:
|
241
|
+
- name: windows2008-r2
|
242
|
+
driver_config:
|
243
|
+
image_urn: MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:latest
|
244
|
+
winrm_powershell_script: |-
|
245
|
+
winrm quickconfig -q
|
246
|
+
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
|
247
|
+
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
|
248
|
+
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
|
249
|
+
winrm set winrm/config/service/auth '@{Basic="true"}'
|
250
|
+
|
251
|
+
```
|
252
|
+
|
253
|
+
#### pre_deployment_template
|
254
|
+
|
255
|
+
* _string_ : Optional path to name of pre-deployment template to use.
|
256
|
+
|
257
|
+
#### pre_deployment_parameters
|
258
|
+
|
259
|
+
* _hash_ : Optional parameters to pass to pre-deployment template.
|
260
|
+
|
261
|
+
#### post_deployment_template
|
262
|
+
|
263
|
+
* _string_ : Optional path to name of post-deployment template to use.
|
264
|
+
|
265
|
+
#### post_deployment_parameters
|
266
|
+
|
267
|
+
* _hash_ : Optional parameters to pass to post-deployment template.
|
268
|
+
|
269
|
+
#### plan
|
270
|
+
|
271
|
+
* _hash_ : Optional JSON object which allows you to define plan information when creating VMs from Marketplace images. Please refer to [Deploy an image with Marketplace terms](https://aka.ms/azuremarketplaceapideployment) for more details. Not all Marketplace images support programmatic deployment, and support is controlled by the image publisher.
|
272
|
+
|
273
|
+
#### vm_tags
|
274
|
+
|
275
|
+
* _hash_ : Optional hash of vm tags to populate.
|
276
|
+
|
277
|
+
#### use_managed_disks
|
278
|
+
|
279
|
+
* _boolean_ : Must be set to `true` to use `data_disks` property.
|
280
|
+
* Default Value: `true`
|
281
|
+
|
282
|
+
#### data_disks
|
283
|
+
|
284
|
+
* _array_ : Additional disks to configure for instances.
|
285
|
+
|
286
|
+
```yaml
|
287
|
+
platforms:
|
288
|
+
- name: windows2016-noformat
|
289
|
+
driver:
|
290
|
+
image_urn: MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest
|
291
|
+
data_disks:
|
292
|
+
- lun: 0
|
293
|
+
disk_size_gb: 128
|
294
|
+
- lun: 1
|
295
|
+
disk_size_gb: 128
|
296
|
+
- lun: 2
|
297
|
+
disk_size_gb: 128
|
298
|
+
```
|
299
|
+
|
300
|
+
#### format_data_disks
|
301
|
+
|
302
|
+
* _boolean_ : Run format operations on attached data disks
|
303
|
+
* Default Value: `false`
|
304
|
+
|
305
|
+
#### format_data_disks_powershell_script
|
306
|
+
|
307
|
+
* _boolean_ : Customize the content of format operations for attached `data_disks`
|
308
|
+
* Default Value: `false`
|
309
|
+
|
310
|
+
#### system_assigned_identity
|
311
|
+
|
312
|
+
* _boolean_ : Whether to enable system assigned identity for the vm.
|
313
|
+
* Default Value: `false`
|
314
|
+
|
315
|
+
#### user_assigned_identities
|
316
|
+
|
317
|
+
* _hash_ : An object whose keys are resource IDs for user identities to associate with the Virtual Machine and whose values are empty objects, or empty to disable user assigned
|
318
|
+
identities.
|
319
|
+
|
320
|
+
#### deployment_sleep
|
321
|
+
|
322
|
+
* _string_ : Time in seconds to sleep at the end of deployment before fetching details.
|
323
|
+
* Default Value: `10`
|
324
|
+
|
325
|
+
#### secret_url
|
326
|
+
|
327
|
+
* _string_ : used with connecting to Azure Key Vault
|
328
|
+
|
329
|
+
#### vault_name
|
330
|
+
|
331
|
+
* _string_ : used with connecting to Azure Key Vault
|
332
|
+
|
333
|
+
#### vault_resource_group
|
334
|
+
|
335
|
+
* _string_ : used with connecting to Azure Key Vault
|
336
|
+
|
337
|
+
#### azure_api_retries
|
338
|
+
|
339
|
+
* _string_ : Number of times to retry connections to Azure API.
|
340
|
+
* Default Value: `5`
|
341
|
+
|
342
|
+
#### use_fqdn_hostname
|
343
|
+
|
344
|
+
* _boolean_ : When true, Kitchen will use the FQDN that is assigned to the Virtual Machine. When false, kitchen will use the public IP address of the machine. This may overcome issues with Corporate firewalls or VPNs blocking Public IP addresses.
|
345
|
+
* Default Value: `false`
|
346
|
+
|
347
|
+
### kitchen.yml example 1 - Linux/Ubuntu
|
348
|
+
|
349
|
+
Here's an example ```kitchen.yml``` file that provisions an Ubuntu Server, using Chef Zero as the provisioner and SSH as the transport. Note that if the key does not exist at the specified location, it will be created. Also note that if ```ssh_key``` is supplied, Test Kitchen will use this in preference to any default/configured passwords that are supplied.
|
83
350
|
|
84
351
|
```yaml
|
85
352
|
---
|
@@ -103,8 +370,6 @@ platforms:
|
|
103
370
|
|
104
371
|
suites:
|
105
372
|
- name: default
|
106
|
-
run_list:
|
107
|
-
- recipe[kitchentesting::default]
|
108
373
|
attributes:
|
109
374
|
```
|
110
375
|
|
@@ -116,9 +381,9 @@ Concurrent execution of create/converge/destroy is supported via the --concurren
|
|
116
381
|
|
117
382
|
Where n is the number of threads to create. Note that any failure (e.g. an AzureOperationError) will cause the whole test to fail, though resources already in creation will continue to be created.
|
118
383
|
|
119
|
-
###
|
384
|
+
### kitchen.yml example 2 - Windows
|
120
385
|
|
121
|
-
Here's a further example
|
386
|
+
Here's a further example ```kitchen.yml``` file that will provision a Windows Server 2019 [smalldisk] instance, using WinRM as the transport. An [ephemeral os disk](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks) is used. The resource created in Azure will enable itself for remote access at deployment time (it does this by customizing the machine at provisioning time) and tags the Azure Resource Group with metadata using the ```resource_group_tags``` property. Notice that the ```vm_tags``` and ```resource_group_tags``` properties use a simple ```key : value``` structure per line:
|
122
387
|
|
123
388
|
```yaml
|
124
389
|
---
|
@@ -146,12 +411,10 @@ platforms:
|
|
146
411
|
name: winrm
|
147
412
|
suites:
|
148
413
|
- name: default
|
149
|
-
run_list:
|
150
|
-
- recipe[kitchentesting::default]
|
151
414
|
attributes:
|
152
415
|
```
|
153
416
|
|
154
|
-
###
|
417
|
+
### kitchen.yml example 3 - "pre-deployment" ARM template
|
155
418
|
|
156
419
|
The following example introduces the ```pre_deployment_template``` and ```pre_deployment_parameters``` properties in the configuration file.
|
157
420
|
You can use this capability to execute an ARM template containing Azure resources to provision before the system under test is created.
|
@@ -225,7 +488,7 @@ Example predeploy.json:
|
|
225
488
|
}
|
226
489
|
```
|
227
490
|
|
228
|
-
###
|
491
|
+
### kitchen.yml example 4 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios)
|
229
492
|
|
230
493
|
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.
|
231
494
|
You can use this capability to create the VM on an existing virtual network and subnet created in a different resource group.
|
@@ -255,12 +518,10 @@ platforms:
|
|
255
518
|
|
256
519
|
suites:
|
257
520
|
- name: default
|
258
|
-
run_list:
|
259
|
-
- recipe[kitchen-azurerm-demo::default]
|
260
521
|
attributes:
|
261
522
|
```
|
262
523
|
|
263
|
-
###
|
524
|
+
### kitchen.yml example 5 - deploy VM to existing virtual network/subnet with a Standard SKU public IP (use for ExpressRoute/VPN scenarios)
|
264
525
|
|
265
526
|
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
527
|
You can use this capability to create the VM on an existing virtual network and subnet created in a different resource group.
|
@@ -293,12 +554,10 @@ platforms:
|
|
293
554
|
|
294
555
|
suites:
|
295
556
|
- name: default
|
296
|
-
run_list:
|
297
|
-
- recipe[kitchen-azurerm-demo::default]
|
298
557
|
attributes:
|
299
558
|
```
|
300
559
|
|
301
|
-
###
|
560
|
+
### kitchen.yml example 6 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Managed Image
|
302
561
|
|
303
562
|
This example is the same as above, but uses a private managed image to provision the vm.
|
304
563
|
|
@@ -328,12 +587,10 @@ platforms:
|
|
328
587
|
|
329
588
|
suites:
|
330
589
|
- name: default
|
331
|
-
run_list:
|
332
|
-
- recipe[kitchen-azurerm-demo::default]
|
333
590
|
attributes:
|
334
591
|
```
|
335
592
|
|
336
|
-
###
|
593
|
+
### kitchen.yml example 7 - deploy VM to existing virtual network/subnet (use for ExpressRoute/VPN scenarios) with Private Classic OS Image
|
337
594
|
|
338
595
|
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.
|
339
596
|
|
@@ -371,12 +628,10 @@ platforms:
|
|
371
628
|
|
372
629
|
suites:
|
373
630
|
- name: default
|
374
|
-
run_list:
|
375
|
-
- recipe[kitchen-azurerm-demo::default]
|
376
631
|
attributes:
|
377
632
|
```
|
378
633
|
|
379
|
-
###
|
634
|
+
### 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
|
380
635
|
|
381
636
|
This is the same as above, but uses custom data to customize the instance.
|
382
637
|
|
@@ -416,12 +671,10 @@ platforms:
|
|
416
671
|
|
417
672
|
suites:
|
418
673
|
- name: default
|
419
|
-
run_list:
|
420
|
-
- recipe[kitchen-azurerm-demo::default]
|
421
674
|
attributes:
|
422
675
|
```
|
423
676
|
|
424
|
-
###
|
677
|
+
### kitchen.yml example 9 - Windows 2016 VM with additional data disks
|
425
678
|
|
426
679
|
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.
|
427
680
|
|
@@ -453,12 +706,10 @@ platforms:
|
|
453
706
|
|
454
707
|
suites:
|
455
708
|
- name: default
|
456
|
-
run_list:
|
457
|
-
- recipe[kitchentesting::default]
|
458
709
|
attributes:
|
459
710
|
```
|
460
711
|
|
461
|
-
###
|
712
|
+
### kitchen.yml example 10 - "post-deployment" ARM template with MSI authentication
|
462
713
|
|
463
714
|
The following example introduces the ```post_deployment_template``` and ```post_deployment_parameters``` properties in the configuration file.
|
464
715
|
You can use this capability to execute an ARM template containing Azure resources to provision after the system under test is created.
|
@@ -490,8 +741,6 @@ platforms:
|
|
490
741
|
|
491
742
|
suites:
|
492
743
|
- name: default
|
493
|
-
run_list:
|
494
|
-
- recipe[kitchen-azurerm-demo::default]
|
495
744
|
attributes:
|
496
745
|
```
|
497
746
|
|
@@ -544,7 +793,7 @@ Example postdeploy.json to enable MSI extention on VM:
|
|
544
793
|
}
|
545
794
|
```
|
546
795
|
|
547
|
-
###
|
796
|
+
### kitchen.yml example 11 - Enabling Managed Service Identities
|
548
797
|
|
549
798
|
This example demonstrates how to enable a System Assigned Identity and User Assigned Identities on a Kitchen VM.
|
550
799
|
Any combination of System and User assigned identities may be enabled, and multiple User Assigned Identities can be supplied.
|
@@ -575,12 +824,10 @@ platforms:
|
|
575
824
|
|
576
825
|
suites:
|
577
826
|
- name: default
|
578
|
-
run_list:
|
579
|
-
- recipe[kitchentesting::default]
|
580
827
|
attributes:
|
581
828
|
```
|
582
829
|
|
583
|
-
###
|
830
|
+
### kitchen.yml example 12 - deploy VM with key vault certificate
|
584
831
|
|
585
832
|
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.
|
586
833
|
|
@@ -606,8 +853,6 @@ platforms:
|
|
606
853
|
|
607
854
|
suites:
|
608
855
|
- name: default
|
609
|
-
run_list:
|
610
|
-
- recipe[kitchentesting::default]
|
611
856
|
attributes:
|
612
857
|
```
|
613
858
|
|
@@ -617,7 +862,7 @@ Starting with v0.9.0 this driver has support for Azure Government and Sovereign
|
|
617
862
|
|
618
863
|
Note that the ```use_managed_disks``` option should be set to false until supported by AzureUSGovernment.
|
619
864
|
|
620
|
-
### Example
|
865
|
+
### Example kitchen.yml for Azure US Government cloud
|
621
866
|
|
622
867
|
```yaml
|
623
868
|
---
|
@@ -644,8 +889,6 @@ platforms:
|
|
644
889
|
|
645
890
|
suites:
|
646
891
|
- name: default
|
647
|
-
run_list:
|
648
|
-
- recipe[vmtesting::default]
|
649
892
|
```
|
650
893
|
|
651
894
|
### How to retrieve the image_urn
|
@@ -683,70 +926,6 @@ data: Canonical UbuntuServer 15.10-DAILY 15.10.201509220 westeurope
|
|
683
926
|
info: vm image list command OK
|
684
927
|
```
|
685
928
|
|
686
|
-
### Additional parameters that can be specified in your `kitchen.yml` or added to your personal `kitchen.local.yml`
|
687
|
-
|
688
|
-
* Note that the ```driver``` section can also take explicit values for ```username``` and ```password```. Otherwise, the default username is "azure" and the password is a randomly generated 24 character password that can be found in your local kitchen state file (typically `.kitchen/<instance-name>.yml`) if you require it for any reason.
|
689
|
-
|
690
|
-
* The ```storage_account_type``` parameter defaults to 'Standard_LRS' and allows you to switch to premium storage (e.g. 'Premium_LRS')
|
691
|
-
|
692
|
-
* The ```enable_boot_diagnostics``` parameter defaults to 'true' and allows you to switch off boot diagnostics in case you are using premium storage.
|
693
|
-
|
694
|
-
* The optional ```vm_tags``` parameter allows you to define key:value pairs to tag VMs with on creation.
|
695
|
-
|
696
|
-
* The optional ```plan``` parameter allows you to define plan information when creating VMs from Marketplace images. Please refer to [Deploy an image with Marketplace terms](https://aka.ms/azuremarketplaceapideployment) for more details. Not all Marketplace images support programmatic deployment, and support is controlled by the image publisher.
|
697
|
-
|
698
|
-
* Managed disks are now enabled by default, to use the Storage account set ```use_managed_disks``` (default: true).
|
699
|
-
|
700
|
-
* The ```image_url``` (unmanaged disks only) parameter can be used to specify a custom vhd (This VHD must be in the same storage account as the disks of the VM, therefore ```existing_storage_account_blob_url``` must also be set and ```use_managed_disks``` must be set to false)
|
701
|
-
|
702
|
-
* The ```image_id``` (managed disks only) parameter can be used to specify an image by id (managed disk). This works only with managed disks.
|
703
|
-
|
704
|
-
* The ```existing_storage_account_blob_url``` can be specified to specify an url to an existing storage account (needed for ```image_url```)
|
705
|
-
|
706
|
-
* The ```custom_data``` parameter can be used to specify custom data to provide to the instance. This can be a file or the data itself. This module handles base64 encoding for you.
|
707
|
-
|
708
|
-
* The ```os_disk_size_gb``` parameter can be used to specify a custom os disk size.
|
709
|
-
|
710
|
-
* The ```azure_resource_group_prefix``` and ```azure_resource_group_suffix``` can be used to further disambiguate Azure resource group names created by the driver.
|
711
|
-
|
712
|
-
* The ```explicit_resource_group_name``` and ```destroy_explicit_resource_group``` (default: "true") parameters can be used in scenarios where you are provided a pre-created Resource Group. Example usage: ```explicit_resource_group_name: kitchen-<%= ENV["USERNAME"] %>```. The ```destroy_explicit_resource_group``` option can now be used after using the ```destroy_resource_group_contents``` option creates an empty resource group to destroy the resource group previously created.
|
713
|
-
|
714
|
-
* The ```destroy_resource_group_contents``` (default: "false") parameter can be used when you want to destroy the resources within a resource group without destroying the resource group itself. For example, the following configuration options used in combination would use an existing resource group (or create one if it doesn't exist) and will destroy the contents of the resource group in the ```kitchen destroy``` phase. If you wish to destroy the empty resource group created after you empty the resource group with this flag you can now set the ```destroy_explicit_resource_group``` to "true" to destroy the empty resource group.
|
715
|
-
|
716
|
-
* The ```destroy_explicit_resource_group_tags``` (default: "true") parameter can be used when you want to remove tags associated with an explicit resource group. The default setting is set to "true" to remain consistent with previous behavior. This should be used in combination with an ```explicit_resource_group_name``` and will be honored during the ```kitchen destroy``` phase.
|
717
|
-
|
718
|
-
```yaml
|
719
|
-
---
|
720
|
-
driver:
|
721
|
-
explicit_resource_group_name: stuart-rg-demo-001
|
722
|
-
destroy_explicit_resource_group: false
|
723
|
-
destroy_resource_group_contents: true
|
724
|
-
```
|
725
|
-
|
726
|
-
* The ```use_ephemeral_osdisk``` (default: false) parameter can be used if you wish to use [ephemeral OS disk functionality](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks).
|
727
|
-
|
728
|
-
* The ```secret_url```, ```vault_name```, and ```vault_resource_group``` parameters can be used to deploy VM with specified key vault certificate.
|
729
|
-
|
730
|
-
* The ```use_fqdn_hostname``` (default: "false") parameter can be used to determine how kitchen communicates with the Virtual Machine. When true, Kitchen will use the FQDN that is assigned to the Virtual Machine. When false, kitchen will use the public IP address of the machine. This may overcome issues with Corporate firewalls or VPNs blocking Public IP addresses.
|
731
|
-
|
732
|
-
## Enabling alternative WinRM configurations
|
733
|
-
|
734
|
-
* By default on Windows machines, a PowerShell script runs that enables WinRM over the SSL transport, for Basic, Negotiate and CredSSP connections. To supply your own PowerShell script (e.g. to enable HTTP), use the `winrm_powershell_script` parameter. Windows 2008 R2 example:
|
735
|
-
|
736
|
-
```yaml
|
737
|
-
platforms:
|
738
|
-
- name: windows2008-r2
|
739
|
-
driver_config:
|
740
|
-
image_urn: MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:latest
|
741
|
-
winrm_powershell_script: |-
|
742
|
-
winrm quickconfig -q
|
743
|
-
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
|
744
|
-
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
|
745
|
-
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
|
746
|
-
winrm set winrm/config/service/auth '@{Basic="true"}'
|
747
|
-
|
748
|
-
```
|
749
|
-
|
750
929
|
## Contributing
|
751
930
|
|
752
931
|
Contributions to the project are welcome via submitting Pull Requests.
|
@@ -763,7 +942,7 @@ Stuart Preston
|
|
763
942
|
|
764
943
|
## License and Copyright
|
765
944
|
|
766
|
-
Copyright 2015-
|
945
|
+
Copyright 2015-2021, Chef Software, Inc.
|
767
946
|
|
768
947
|
```
|
769
948
|
Licensed under the Apache License, Version 2.0 (the "License");
|
data/templates/internal.erb
CHANGED
@@ -40,10 +40,9 @@
|
|
40
40
|
"description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
|
41
41
|
}
|
42
42
|
},
|
43
|
-
<%- if public_ip_sku %>
|
44
43
|
"publicIPSKU": {
|
45
44
|
"type": "string",
|
46
|
-
"defaultValue": "
|
45
|
+
"defaultValue": "Basic",
|
47
46
|
"metadata": {
|
48
47
|
"description": "SKU name for the Public IP used to access the Virtual Machine."
|
49
48
|
}
|
@@ -55,7 +54,6 @@
|
|
55
54
|
"description": "SKU name for the Public IP used to access the Virtual Machine."
|
56
55
|
}
|
57
56
|
},
|
58
|
-
<%- end %>
|
59
57
|
<%- unless os_disk_size_gb.to_s.empty? -%>
|
60
58
|
"osDiskSizeGb": {
|
61
59
|
"type": "int",
|
@@ -261,9 +259,9 @@
|
|
261
259
|
"type": "Microsoft.Network/publicIPAddresses",
|
262
260
|
"name": "[variables('publicIPAddressName')]",
|
263
261
|
"location": "[variables('location')]",
|
264
|
-
|
265
|
-
|
266
|
-
|
262
|
+
"sku": {
|
263
|
+
"name": "[parameters('publicIPSKU')]"
|
264
|
+
},
|
267
265
|
"properties": {
|
268
266
|
"publicIPAllocationMethod": "[parameters('publicIPAddressType')]",
|
269
267
|
"dnsSettings": {
|
data/templates/public.erb
CHANGED
@@ -163,6 +163,20 @@
|
|
163
163
|
"description": "The nic name created inside of the resource group."
|
164
164
|
}
|
165
165
|
},
|
166
|
+
"publicIPSKU": {
|
167
|
+
"type": "string",
|
168
|
+
"defaultValue": "Basic",
|
169
|
+
"metadata": {
|
170
|
+
"description": "SKU name for the Public IP used to access the Virtual Machine."
|
171
|
+
}
|
172
|
+
},
|
173
|
+
"publicIPAddressType": {
|
174
|
+
"type": "string",
|
175
|
+
"defaultValue": "Dynamic",
|
176
|
+
"metadata": {
|
177
|
+
"description": "SKU name for the Public IP used to access the Virtual Machine."
|
178
|
+
}
|
179
|
+
},
|
166
180
|
"storageAccountType": {
|
167
181
|
"type": "string",
|
168
182
|
"defaultValue": "<%= storage_account_type %>",
|
@@ -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')]",
|
@@ -213,7 +226,7 @@
|
|
213
226
|
"resources": [
|
214
227
|
{
|
215
228
|
"apiVersion": "2017-05-10",
|
216
|
-
"name": "pid-18d63047-6cdf-4f34-beed-62f01fc73fc2",
|
229
|
+
"name": "pid-18d63047-6cdf-4f34-beed-62f01fc73fc2",
|
217
230
|
"type": "Microsoft.Resources/deployments",
|
218
231
|
"properties": {
|
219
232
|
"mode": "Incremental",
|
@@ -241,16 +254,19 @@
|
|
241
254
|
<%- end -%>
|
242
255
|
<%- end -%>
|
243
256
|
{
|
244
|
-
"apiVersion": "
|
257
|
+
"apiVersion": "2017-08-01",
|
245
258
|
"type": "Microsoft.Network/publicIPAddresses",
|
246
259
|
"name": "[variables('publicIPAddressName')]",
|
247
260
|
"location": "[variables('location')]",
|
248
261
|
"properties": {
|
249
|
-
"publicIPAllocationMethod": "[
|
262
|
+
"publicIPAllocationMethod": "[parameters('publicIPAddressType')]",
|
250
263
|
"dnsSettings": {
|
251
264
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
252
265
|
}
|
253
266
|
},
|
267
|
+
"sku": {
|
268
|
+
"name": "[parameters('publicIPSKU')]"
|
269
|
+
},
|
254
270
|
"tags": {
|
255
271
|
<%= vm_tags unless vm_tags.empty? %>
|
256
272
|
}
|
@@ -362,12 +378,12 @@
|
|
362
378
|
},
|
363
379
|
<%- end -%>
|
364
380
|
<%- if use_ephemeral_osdisk -%>
|
365
|
-
"osDisk": {
|
366
|
-
"diffDiskSettings": {
|
367
|
-
"option": "Local"
|
368
|
-
},
|
369
|
-
"caching": "ReadOnly",
|
370
|
-
"createOption": "FromImage"
|
381
|
+
"osDisk": {
|
382
|
+
"diffDiskSettings": {
|
383
|
+
"option": "Local"
|
384
|
+
},
|
385
|
+
"caching": "ReadOnly",
|
386
|
+
"createOption": "FromImage"
|
371
387
|
}
|
372
388
|
<%- elsif use_managed_disks -%>
|
373
389
|
"osDisk": {
|
@@ -408,7 +424,7 @@
|
|
408
424
|
}
|
409
425
|
<%- end -%>
|
410
426
|
<%- unless data_disks_for_vm_json.nil? -%>
|
411
|
-
,"dataDisks":
|
427
|
+
,"dataDisks":
|
412
428
|
<%= data_disks_for_vm_json %>
|
413
429
|
<%- end -%>
|
414
430
|
},
|
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.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Preston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: azure_mgmt_network
|