kitchen-azurerm 0.14.8 → 0.14.9

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: 97bbd49be5ec263bf62071763c58b4c5e1fcf9fd43032182e4129ab648d480eb
4
- data.tar.gz: 61b500b1cea1e867b23380aa4768aa1a48d301dd5ecd299b80508d54af5ce214
3
+ metadata.gz: 0ffc284510dde72d7b781d6069cdd68b7d52b3c5877f5826b99da3e0aa765397
4
+ data.tar.gz: 38d52dc77c023a9d38dd39857f5f467c053b029d906858f987bcd73b3d2d4d0b
5
5
  SHA512:
6
- metadata.gz: 0f99b8ab2793552a5bf34d4264250d313284463ca409c26fd7fc899c8c9c44519a8dd1d102b3027fbe463b16ab1a4a7ed2a702005f45595ca045e45ec8dddb34
7
- data.tar.gz: 824de194c5bc3ca87388acbf861d3aceef3db00adc9e66c5b1eedf7faa79836f7e113e722a838c36cef54ec2a7d213e825ddc2cf34ac77665a3ef4cca2e09281
6
+ metadata.gz: ae129c262879fe31efa2fae2c09177d85ca9b42901f5eb23077547f8cea1864c792490ce5ec76a04427304a74a8a7912333d33ee951b2ce31f35e2b0b02a5bf9
7
+ data.tar.gz: cec65b9e6683a321ecab5e86b82f0df8b90f51feb8488efc270a0b6e8ce30e02ad517f83e99f8b0b32d0443e860dd75b2ffe00a8a0b28b244c6655a8422b0710
data/README.md CHANGED
@@ -91,7 +91,7 @@ Where <n> is the number of threads to create. Note that any failure (e.g. an Azu
91
91
 
92
92
  ### .kitchen.yml example 2 - Windows
93
93
 
94
- Here's a further example ```.kitchen.yml``` file that will provision a Windows Server 2012 R2 instance, using WinRM as the transport. 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:
94
+ 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:
95
95
 
96
96
  ```yaml
97
97
  ---
@@ -99,15 +99,16 @@ driver:
99
99
  name: azurerm
100
100
  subscription_id: '4801fa9d-YOUR-GUID-HERE-b265ff49ce21'
101
101
  location: 'West Europe'
102
- machine_size: 'Standard_D1'
102
+ machine_size: 'Standard_DS2_v2'
103
103
 
104
104
  provisioner:
105
105
  name: chef_zero
106
106
 
107
107
  platforms:
108
- - name: windows2012-r2
108
+ - name: windows2019
109
109
  driver:
110
- image_urn: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest
110
+ image_urn: MicrosoftWindowsServer:WindowsServer:2019-Datacenter-smalldisk:latest
111
+ use_ephemeral_osdisk: true
111
112
  resource_group_tags:
112
113
  project: 'My Cool Project'
113
114
  contact: 'me@somewhere.com'
@@ -601,6 +602,8 @@ info: vm image list command OK
601
602
  - The ```azure_resource_group_prefix``` and ```azure_resource_group_suffix``` can be used to further disambiguate Azure resource group names created by the driver.
602
603
  - 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"] %>```
603
604
  - 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.
605
+ - 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).
606
+
604
607
  ```
605
608
  ---
606
609
  driver:
@@ -50,6 +50,10 @@ module Kitchen
50
50
  ""
51
51
  end
52
52
 
53
+ default_config(:use_ephemeral_osdisk) do |_config|
54
+ false
55
+ end
56
+
53
57
  default_config(:os_disk_size_gb) do |_config|
54
58
  ""
55
59
  end
@@ -162,6 +166,10 @@ module Kitchen
162
166
  false
163
167
  end
164
168
 
169
+ default_config(:deployment_sleep) do |_config|
170
+ 10
171
+ end
172
+
165
173
  def create(state)
166
174
  state = validate_state(state)
167
175
  deployment_parameters = {
@@ -357,7 +365,11 @@ module Kitchen
357
365
 
358
366
  output = k.ssh_public_key
359
367
  else
360
- output = File.read("#{private_key_filename}.pub")
368
+ output = if instance.transport[:ssh_public_key].nil?
369
+ File.read("#{private_key_filename}.pub")
370
+ else
371
+ File.read(instance.transport[:ssh_public_key])
372
+ end
361
373
  end
362
374
  output.strip
363
375
  end
@@ -430,7 +442,7 @@ module Kitchen
430
442
  end_provisioning_state_reached = false
431
443
  until end_provisioning_state_reached
432
444
  list_outstanding_deployment_operations(resource_group, deployment_name)
433
- sleep 10
445
+ sleep config[:deployment_sleep]
434
446
  deployment_provisioning_state = deployment_state(resource_group, deployment_name)
435
447
  end_provisioning_state_reached = end_provisioning_states.split(",").include?(deployment_provisioning_state)
436
448
  end
@@ -591,10 +603,10 @@ module Kitchen
591
603
 
592
604
  def virtual_machine_deployment_template
593
605
  if config[:vnet_id] == ""
594
- virtual_machine_deployment_template_file("public.erb", vm_tags: vm_tag_string(config[:vm_tags]), use_managed_disks: config[:use_managed_disks], image_url: config[:image_url], existing_storage_account_blob_url: config[:existing_storage_account_blob_url], image_id: config[:image_id], existing_storage_account_container: config[:existing_storage_account_container], custom_data: config[:custom_data], os_disk_size_gb: config[:os_disk_size_gb], data_disks_for_vm_json: data_disks_for_vm_json)
606
+ virtual_machine_deployment_template_file("public.erb", vm_tags: vm_tag_string(config[:vm_tags]), use_managed_disks: config[:use_managed_disks], image_url: config[:image_url], existing_storage_account_blob_url: config[:existing_storage_account_blob_url], image_id: config[:image_id], existing_storage_account_container: config[:existing_storage_account_container], custom_data: config[:custom_data], os_disk_size_gb: config[:os_disk_size_gb], data_disks_for_vm_json: data_disks_for_vm_json, use_ephemeral_osdisk: config[:use_ephemeral_osdisk])
595
607
  else
596
608
  info "Using custom vnet: #{config[:vnet_id]}"
597
- virtual_machine_deployment_template_file("internal.erb", vnet_id: config[:vnet_id], subnet_id: config[:subnet_id], public_ip: config[:public_ip], vm_tags: vm_tag_string(config[:vm_tags]), use_managed_disks: config[:use_managed_disks], image_url: config[:image_url], existing_storage_account_blob_url: config[:existing_storage_account_blob_url], image_id: config[:image_id], existing_storage_account_container: config[:existing_storage_account_container], custom_data: config[:custom_data], os_disk_size_gb: config[:os_disk_size_gb], data_disks_for_vm_json: data_disks_for_vm_json)
609
+ virtual_machine_deployment_template_file("internal.erb", vnet_id: config[:vnet_id], subnet_id: config[:subnet_id], public_ip: config[:public_ip], vm_tags: vm_tag_string(config[:vm_tags]), use_managed_disks: config[:use_managed_disks], image_url: config[:image_url], existing_storage_account_blob_url: config[:existing_storage_account_blob_url], image_id: config[:image_id], existing_storage_account_container: config[:existing_storage_account_container], custom_data: config[:custom_data], os_disk_size_gb: config[:os_disk_size_gb], data_disks_for_vm_json: data_disks_for_vm_json, use_ephemeral_osdisk: config[:use_ephemeral_osdisk])
598
610
  end
599
611
  end
600
612
 
@@ -263,7 +263,7 @@
263
263
  }
264
264
  },
265
265
  {
266
- "apiVersion": "2018-04-01",
266
+ "apiVersion": "2018-06-01",
267
267
  "type": "Microsoft.Compute/virtualMachines",
268
268
  "name": "[variables('vmName')]",
269
269
  "location": "[variables('location')]",
@@ -300,7 +300,15 @@
300
300
  "id": "[parameters('imageId')]"
301
301
  },
302
302
  <%- end -%>
303
- <%- if use_managed_disks -%>
303
+ <%- if use_ephemeral_osdisk -%>
304
+ "osDisk": {
305
+ "diffDiskSettings": {
306
+ "option": "Local"
307
+ },
308
+ "caching": "ReadOnly",
309
+ "createOption": "FromImage"
310
+ }
311
+ <%- elsif use_managed_disks -%>
304
312
  "osDisk": {
305
313
  "name": "osdisk",
306
314
  <%- unless os_disk_size_gb.to_s.empty? -%>
data/templates/public.erb CHANGED
@@ -282,7 +282,7 @@
282
282
  }
283
283
  },
284
284
  {
285
- "apiVersion": "2018-04-01",
285
+ "apiVersion": "2018-06-01",
286
286
  "type": "Microsoft.Compute/virtualMachines",
287
287
  "name": "[variables('vmName')]",
288
288
  "location": "[variables('location')]",
@@ -319,7 +319,15 @@
319
319
  "id": "[parameters('imageId')]"
320
320
  },
321
321
  <%- end -%>
322
- <%- if use_managed_disks -%>
322
+ <%- if use_ephemeral_osdisk -%>
323
+ "osDisk": {
324
+ "diffDiskSettings": {
325
+ "option": "Local"
326
+ },
327
+ "caching": "ReadOnly",
328
+ "createOption": "FromImage"
329
+ }
330
+ <%- elsif use_managed_disks -%>
323
331
  "osDisk": {
324
332
  "name": "osdisk",
325
333
  <%- unless os_disk_size_gb.to_s.empty? -%>
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: 0.14.8
4
+ version: 0.14.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Preston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-30 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure_mgmt_network
@@ -94,16 +94,16 @@ dependencies:
94
94
  name: bundler
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: '1.7'
99
+ version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
102
  version_requirements: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - "~>"
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
- version: '1.7'
106
+ version: '0'
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: rake
109
109
  requirement: !ruby/object:Gem::Requirement
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubygems_version: 3.0.1
168
+ rubygems_version: 3.0.3
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: Test Kitchen driver for Azure Resource Manager.