knife-azure 1.9.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/azure/azure_interface.rb +2 -3
  3. data/lib/azure/custom_errors.rb +1 -1
  4. data/lib/azure/helpers.rb +1 -1
  5. data/lib/azure/resource_management/ARM_deployment_template.rb +157 -162
  6. data/lib/azure/resource_management/ARM_interface.rb +72 -73
  7. data/lib/azure/resource_management/vnet_config.rb +11 -10
  8. data/lib/azure/resource_management/windows_credentials.rb +19 -19
  9. data/lib/azure/service_management/ASM_interface.rb +6 -5
  10. data/lib/azure/service_management/ag.rb +11 -11
  11. data/lib/azure/service_management/certificate.rb +7 -5
  12. data/lib/azure/service_management/connection.rb +10 -10
  13. data/lib/azure/service_management/deploy.rb +12 -14
  14. data/lib/azure/service_management/disk.rb +4 -2
  15. data/lib/azure/service_management/host.rb +7 -4
  16. data/lib/azure/service_management/image.rb +4 -4
  17. data/lib/azure/service_management/loadbalancer.rb +2 -2
  18. data/lib/azure/service_management/rest.rb +9 -8
  19. data/lib/azure/service_management/role.rb +67 -70
  20. data/lib/azure/service_management/storageaccount.rb +5 -3
  21. data/lib/azure/service_management/utility.rb +1 -1
  22. data/lib/azure/service_management/vnet.rb +1 -1
  23. data/lib/chef/knife/azure_ag_create.rb +13 -13
  24. data/lib/chef/knife/azure_ag_list.rb +1 -1
  25. data/lib/chef/knife/azure_base.rb +49 -66
  26. data/lib/chef/knife/azure_image_list.rb +6 -6
  27. data/lib/chef/knife/azure_internal-lb_create.rb +14 -14
  28. data/lib/chef/knife/azure_internal-lb_list.rb +1 -1
  29. data/lib/chef/knife/azure_server_create.rb +233 -268
  30. data/lib/chef/knife/azure_server_delete.rb +31 -31
  31. data/lib/chef/knife/azure_server_list.rb +1 -1
  32. data/lib/chef/knife/azure_server_show.rb +1 -1
  33. data/lib/chef/knife/azure_vnet_create.rb +15 -19
  34. data/lib/chef/knife/azure_vnet_list.rb +1 -1
  35. data/lib/chef/knife/azurerm_base.rb +39 -28
  36. data/lib/chef/knife/azurerm_server_create.rb +112 -177
  37. data/lib/chef/knife/azurerm_server_delete.rb +13 -13
  38. data/lib/chef/knife/azurerm_server_list.rb +1 -1
  39. data/lib/chef/knife/azurerm_server_show.rb +1 -1
  40. data/lib/chef/knife/bootstrap/bootstrapper.rb +34 -238
  41. data/lib/chef/knife/bootstrap/common_bootstrap_options.rb +77 -76
  42. data/lib/chef/knife/bootstrap_azure.rb +56 -33
  43. data/lib/chef/knife/bootstrap_azurerm.rb +46 -29
  44. data/lib/knife-azure/version.rb +18 -1
  45. metadata +28 -16
  46. data/lib/chef/knife/bootstrap/bootstrap_options.rb +0 -105
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bc419ff395adbbe39c51a8d1eaf3534df6e518026102fd3a295ea843bede060
4
- data.tar.gz: be1a3359b55940c8f5461754eefad9fa03af780e5f46f5f51be5f87680158765
3
+ metadata.gz: a4992071460b92c0325d97a11cfd76184cfcd07f771404edf78ed6362ef576fb
4
+ data.tar.gz: 7041fd59542fc9ec2808a3898fa6a60a5d72877ad0539920b383eb07dac9d72d
5
5
  SHA512:
6
- metadata.gz: c990a0a17420b5c9e82c4ec8350deee4f954ada8113545b51bb74775b98af8b1e8110e34c23d89ca4141902543bf1720be952aaeb4d9c5b67125bc9677bf4bb9
7
- data.tar.gz: 1c7089b5c10bed855987c4eb794866186d9061cb3e42ea4ed95bbf6a774e1fa6ba4e8951f13ad4b6ebfb752ee35d5527d32ae7c60e8c974805ace4ed76928cc2
6
+ metadata.gz: 65dd03f7cac3721756a331614b7f8275481a22cf243e10d5a6ebc74e0582533258190ff7aca0ff54927ab1fb04ba5e4b403df634e82709a914a934f8fed52363
7
+ data.tar.gz: f3510839a3f84ed226b52527253f3aa9ad72c5dcf9ce9be23c3a17b8969906e92e7235445024f0ad1a2494d037983dd94d62098bda1b3b6e339045d93929ea66
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2016-2018 Chef Software, Inc.
2
+ # Copyright:: Copyright 2010-2019, Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,8 +25,7 @@ module Azure
25
25
 
26
26
  attr_accessor :ui
27
27
 
28
- def initialize(options = {})
29
- end
28
+ def initialize(options = {}); end
30
29
 
31
30
  def create_server(params = {})
32
31
  AzureInterface.api_not_implemented(self)
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2016-2018 Chef Software, Inc.
2
+ # Copyright:: Copyright 2010-2019, Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: vasundhara.jagdale@clogeny.com
3
- # Copyright:: Copyright 2016-2018 Chef Software, Inc.
3
+ # Copyright:: Copyright 2010-2019, Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Nimisha Sharad (nimisha.sharad@clogeny.com)
3
- # Copyright:: Copyright 2015-2018 Chef Software, Inc.
3
+ # Copyright:: Copyright 2010-2019, Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,11 +24,11 @@ module Azure::ARM
24
24
  hint_names.each do |hint_name|
25
25
  case hint_name
26
26
  when "vm_name"
27
- hints_json["vm_name"] = "[reference(#{resource_ids['vmId']}).osProfile.computerName]" if !hints_json.has_key? "vm_name"
27
+ hints_json["vm_name"] = "[reference(#{resource_ids["vmId"]}).osProfile.computerName]" unless hints_json.key? "vm_name"
28
28
  when "public_fqdn"
29
- hints_json["public_fqdn"] = "[reference(#{resource_ids['pubId']}).dnsSettings.fqdn]" if !hints_json.has_key? "public_fqdn"
29
+ hints_json["public_fqdn"] = "[reference(#{resource_ids["pubId"]}).dnsSettings.fqdn]" unless hints_json.key? "public_fqdn"
30
30
  when "platform"
31
- hints_json["platform"] = "[concat(reference(#{resource_ids['vmId']}).storageProfile.imageReference.offer, concat(' ', reference(#{resource_ids['vmId']}).storageProfile.imageReference.sku))]" if !hints_json.has_key? "platform"
31
+ hints_json["platform"] = "[concat(reference(#{resource_ids["vmId"]}).storageProfile.imageReference.offer, concat(' ', reference(#{resource_ids["vmId"]}).storageProfile.imageReference.sku))]" unless hints_json.key? "platform"
32
32
  end
33
33
  end
34
34
 
@@ -45,8 +45,8 @@ module Azure::ARM
45
45
  "location" => "[resourceGroup().location]",
46
46
  "properties" => {
47
47
  "securityRules" => [
48
- ]
49
- }
48
+ ],
49
+ },
50
50
  }
51
51
  # Security Rule priority can be set between 100 and 4096
52
52
  rule_no = 300
@@ -64,7 +64,7 @@ module Azure::ARM
64
64
  "destinationAddressPrefix" => "*",
65
65
  "access" => "Allow",
66
66
  "priority" => rule_no,
67
- "direction" => "Inbound"
67
+ "direction" => "Inbound",
68
68
  }
69
69
  )
70
70
  incremental += 1
@@ -151,155 +151,155 @@ module Azure::ARM
151
151
  "adminUserName" => {
152
152
  "type" => "string",
153
153
  "metadata" => {
154
- "description" => "User name for the Virtual Machine."
155
- }
154
+ "description" => "User name for the Virtual Machine.",
155
+ },
156
156
  },
157
157
  "adminPassword" => {
158
158
  "type" => "securestring",
159
159
  "metadata" => {
160
- "description" => "Password for the Virtual Machine."
161
- }
160
+ "description" => "Password for the Virtual Machine.",
161
+ },
162
162
  },
163
163
  "availabilitySetName" => {
164
- "type" => "string"
164
+ "type" => "string",
165
165
  },
166
166
  "availabilitySetPlatformFaultDomainCount" => {
167
- "type" => "string"
167
+ "type" => "string",
168
168
  },
169
169
  "availabilitySetPlatformUpdateDomainCount" => {
170
- "type" => "string"
170
+ "type" => "string",
171
171
  },
172
172
  "numberOfInstances" => {
173
173
  "type" => "int",
174
174
  "defaultValue" => 1,
175
175
  "metadata" => {
176
- "description" => "Number of VM instances to create. Default is 1"
177
- }
176
+ "description" => "Number of VM instances to create. Default is 1",
177
+ },
178
178
  },
179
179
  "dnsLabelPrefix" => {
180
180
  "type" => "string",
181
181
  "metadata" => {
182
- "description" => "Unique DNS Name for the Public IP used to access the Virtual Machine."
183
- }
182
+ "description" => "Unique DNS Name for the Public IP used to access the Virtual Machine.",
183
+ },
184
184
  },
185
185
  "imageSKU" => {
186
186
  "type" => "string",
187
187
  "metadata" => {
188
- "description" => "Version of the image"
189
- }
188
+ "description" => "Version of the image",
189
+ },
190
190
  },
191
191
  "imageVersion" => {
192
192
  "type" => "string",
193
193
  "defaultValue" => "latest",
194
194
  "metadata" => {
195
- "description" => "Azure image reference version."
196
- }
195
+ "description" => "Azure image reference version.",
196
+ },
197
197
  },
198
198
  "validation_key" => {
199
199
  "type" => "string",
200
200
  "metadata" => {
201
- "description" => "JSON Escaped Validation Key"
202
- }
201
+ "description" => "JSON Escaped Validation Key",
202
+ },
203
203
  },
204
204
 
205
205
  "chef_server_crt" => {
206
206
  "type" => "string",
207
207
  "metadata" => {
208
- "description" => "Optional. SSL cerificate provided by user."
209
- }
208
+ "description" => "Optional. SSL cerificate provided by user.",
209
+ },
210
210
  },
211
211
  "chef_server_url" => {
212
212
  "type" => "string",
213
213
  "metadata" => {
214
- "description" => "Organization URL for the Chef Server. Example https://ChefServerDnsName.cloudapp.net/organizations/Orgname"
215
- }
214
+ "description" => "Organization URL for the Chef Server. Example https://ChefServerDnsName.cloudapp.net/organizations/Orgname",
215
+ },
216
216
  },
217
217
  "validation_client_name" => {
218
218
  "type" => "string",
219
219
  "metadata" => {
220
- "description" => "Validator key name for the organization. Example : MyOrg-validator"
221
- }
220
+ "description" => "Validator key name for the organization. Example : MyOrg-validator",
221
+ },
222
222
  },
223
223
  "runlist" => {
224
224
  "type" => "string",
225
225
  "metadata" => {
226
- "description" => "Optional Run List to Execute"
227
- }
226
+ "description" => "Optional Run List to Execute",
227
+ },
228
228
  },
229
229
  "environment" => {
230
230
  "type" => "string",
231
231
  "metadata" => {
232
- "description" => "Chef environment for the node (VM) in the Chef Organization"
233
- }
232
+ "description" => "Chef environment for the node (VM) in the Chef Organization",
233
+ },
234
234
  },
235
235
  "chef_node_name" => {
236
236
  "type" => "string",
237
237
  "metadata" => {
238
- "description" => "The name for the node (VM) in the Chef Organization"
239
- }
238
+ "description" => "The name for the node (VM) in the Chef Organization",
239
+ },
240
240
  },
241
241
  "validation_key_format" => {
242
242
  "type" => "string",
243
243
  "allowedValues" => %w{plaintext base64encoded},
244
244
  "defaultValue" => "plaintext",
245
245
  "metadata" => {
246
- "description" => "Format in which Validation Key is given. e.g. plaintext, base64encoded"
247
- }
246
+ "description" => "Format in which Validation Key is given. e.g. plaintext, base64encoded",
247
+ },
248
248
  },
249
249
  "client_rb" => {
250
250
  "type" => "string",
251
251
  "metadata" => {
252
- "description" => "Optional. Path to a client.rb file for use by the bootstrapped node."
253
- }
252
+ "description" => "Optional. Path to a client.rb file for use by the bootstrapped node.",
253
+ },
254
254
  },
255
255
  "bootstrap_version" => {
256
256
  "type" => "string",
257
257
  "metadata" => {
258
- "description" => "Optional. The version of Chef to install."
259
- }
258
+ "description" => "Optional. The version of Chef to install.",
259
+ },
260
260
  },
261
261
  "custom_json_attr" => {
262
262
  "type" => "string",
263
263
  "metadata" => {
264
- "description" => "Optional. A JSON string to be added to the first run of chef-client."
265
- }
264
+ "description" => "Optional. A JSON string to be added to the first run of chef-client.",
265
+ },
266
266
  },
267
267
  "node_ssl_verify_mode" => {
268
268
  "type" => "string",
269
269
  "metadata" => {
270
- "description" => "Optional. Whether or not to verify the SSL cert for all HTTPS requests."
271
- }
270
+ "description" => "Optional. Whether or not to verify the SSL cert for all HTTPS requests.",
271
+ },
272
272
  },
273
273
  "node_verify_api_cert" => {
274
274
  "type" => "string",
275
275
  "metadata" => {
276
- "description" => "Optional. Verify the SSL cert for HTTPS requests to the Chef server API."
277
- }
276
+ "description" => "Optional. Verify the SSL cert for HTTPS requests to the Chef server API.",
277
+ },
278
278
  },
279
279
  "encrypted_data_bag_secret" => {
280
280
  "type" => "string",
281
281
  "metadata" => {
282
- "description" => "Optional. The secret key to use to encrypt data bag item values."
283
- }
282
+ "description" => "Optional. The secret key to use to encrypt data bag item values.",
283
+ },
284
284
  },
285
285
  "bootstrap_proxy" => {
286
286
  "type" => "string",
287
287
  "metadata" => {
288
- "description" => "Optional. The proxy server for the node being bootstrapped."
289
- }
288
+ "description" => "Optional. The proxy server for the node being bootstrapped.",
289
+ },
290
290
  },
291
291
  "sshKeyData" => {
292
292
  "type" => "string",
293
293
  "metadata" => {
294
- "description" => "SSH rsa public key file as a string."
295
- }
294
+ "description" => "SSH rsa public key file as a string.",
295
+ },
296
296
  },
297
297
  "disablePasswordAuthentication" => {
298
298
  "type" => "string",
299
299
  "metadata" => {
300
- "description" => "Set to true if using ssh key for authentication."
301
- }
302
- }
300
+ "description" => "Set to true if using ssh key for authentication.",
301
+ },
302
+ },
303
303
  },
304
304
  "variables" => {
305
305
  "storageAccountName" => "[concat(uniquestring(resourceGroup().id), '#{params[:azure_storage_account]}')]",
@@ -320,7 +320,7 @@ module Azure::ARM
320
320
  "subnetRef" => "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
321
321
  "apiVersion" => "2015-06-15",
322
322
  "vmExtensionName" => "#{params[:chef_extension]}",
323
- "sshKeyPath" => "[concat('/home/',parameters('adminUserName'),'/.ssh/authorized_keys')]"
323
+ "sshKeyPath" => "[concat('/home/',parameters('adminUserName'),'/.ssh/authorized_keys')]",
324
324
  },
325
325
  "resources" => [
326
326
  {
@@ -329,8 +329,8 @@ module Azure::ARM
329
329
  "apiVersion" => "[variables('apiVersion')]",
330
330
  "location" => "[resourceGroup().location]",
331
331
  "properties" => {
332
- "accountType" => "[variables('storageAccountType')]"
333
- }
332
+ "accountType" => "[variables('storageAccountType')]",
333
+ },
334
334
  },
335
335
  {
336
336
  "apiVersion" => "[variables('apiVersion')]",
@@ -339,14 +339,14 @@ module Azure::ARM
339
339
  "location" => "[resourceGroup().location]",
340
340
  "copy" => {
341
341
  "name" => "publicIPLoop",
342
- "count" => "[parameters('numberOfInstances')]"
342
+ "count" => "[parameters('numberOfInstances')]",
343
343
  },
344
344
  "properties" => {
345
345
  "publicIPAllocationMethod" => "[variables('publicIPAddressType')]",
346
346
  "dnsSettings" => {
347
- "domainNameLabel" => domainNameLabel
348
- }
349
- }
347
+ "domainNameLabel" => domainNameLabel,
348
+ },
349
+ },
350
350
  },
351
351
  {
352
352
  "apiVersion" => "[variables('apiVersion')]",
@@ -355,10 +355,10 @@ module Azure::ARM
355
355
  "location" => "[resourceGroup().location]",
356
356
  "properties" => {
357
357
  "addressSpace" => {
358
- "addressPrefixes" => params[:vnet_config][:addressPrefixes]
358
+ "addressPrefixes" => params[:vnet_config][:addressPrefixes],
359
359
  },
360
- "subnets" => params[:vnet_config][:subnets]
361
- }
360
+ "subnets" => params[:vnet_config][:subnets],
361
+ },
362
362
  },
363
363
  {
364
364
  "apiVersion" => "[variables('apiVersion')]",
@@ -367,11 +367,11 @@ module Azure::ARM
367
367
  "location" => "[resourceGroup().location]",
368
368
  "copy" => {
369
369
  "name" => "nicLoop",
370
- "count" => "[parameters('numberOfInstances')]"
370
+ "count" => "[parameters('numberOfInstances')]",
371
371
  },
372
372
  "dependsOn" => [
373
373
  depNic1,
374
- "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
374
+ "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
375
375
  ],
376
376
  "properties" => {
377
377
  "ipConfigurations" => [
@@ -380,15 +380,15 @@ module Azure::ARM
380
380
  "properties" => {
381
381
  "privateIPAllocationMethod" => "Dynamic",
382
382
  "publicIPAddress" => {
383
- "id" => pubId
383
+ "id" => pubId,
384
384
  },
385
385
  "subnet" => {
386
- "id" => "[variables('subnetRef')]"
387
- }
388
- }
389
- }
390
- ]
391
- }
386
+ "id" => "[variables('subnetRef')]",
387
+ },
388
+ },
389
+ },
390
+ ],
391
+ },
392
392
  },
393
393
  {
394
394
  "apiVersion" => "[variables('apiVersion')]",
@@ -397,7 +397,7 @@ module Azure::ARM
397
397
  "location" => "[resourceGroup().location]",
398
398
  "copy" => {
399
399
  "name" => "vmLoop",
400
- "count" => "[parameters('numberOfInstances')]"
400
+ "count" => "[parameters('numberOfInstances')]",
401
401
  },
402
402
  "dependsOn" => [
403
403
  "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
@@ -405,53 +405,53 @@ module Azure::ARM
405
405
  ],
406
406
  "properties" => {
407
407
  "hardwareProfile" => {
408
- "vmSize" => "[variables('vmSize')]"
408
+ "vmSize" => "[variables('vmSize')]",
409
409
  },
410
410
  "osProfile" => {
411
411
  "computerName" => computerName,
412
412
  "adminUserName" => "[parameters('adminUserName')]",
413
413
  "adminPassword" => "[parameters('adminPassword')]",
414
414
  "linuxConfiguration" => ( if params[:disablePasswordAuthentication] == "true"
415
- {
416
- "disablePasswordAuthentication" => "[parameters('disablePasswordAuthentication')]",
417
- "ssh" => {
418
- "publicKeys" => [ {
419
- "path" => "[variables('sshKeyPath')]",
420
- "keyData" => "[parameters('sshKeyData')]"
421
- } ]
422
- }
423
- }
424
- end)
415
+ { "disablePasswordAuthentication" => "[parameters('disablePasswordAuthentication')]",
416
+ "ssh" => {
417
+ "publicKeys" => [{
418
+ "path" => "[variables('sshKeyPath')]",
419
+ "keyData" => "[parameters('sshKeyData')]",
420
+ }],
421
+ },
422
+ }
423
+ end),
425
424
  },
426
425
  "storageProfile" => {
427
426
  "imageReference" => {
428
427
  "publisher" => "[variables('imagePublisher')]",
429
428
  "offer" => "[variables('imageOffer')]",
430
429
  "sku" => "[parameters('imageSKU')]",
431
- "version" => "[parameters('imageVersion')]"
430
+ "version" => "[parameters('imageVersion')]",
432
431
  },
433
432
  "osDisk" => {
434
433
  "name" => "[variables('OSDiskName')]",
435
434
  "vhd" => {
436
- "uri" => uri },
435
+ "uri" => uri,
436
+ },
437
437
  "caching" => "ReadWrite",
438
- "createOption" => "FromImage"
439
- }
438
+ "createOption" => "FromImage",
439
+ },
440
440
  },
441
441
  "networkProfile" => {
442
442
  "networkInterfaces" => [
443
443
  {
444
- "id" => netid
445
- }
446
- ]
444
+ "id" => netid,
445
+ },
446
+ ],
447
447
  },
448
448
  "diagnosticsProfile" => {
449
449
  "bootDiagnostics" => {
450
450
  "enabled" => "true",
451
- "storageUri" => "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net')]"
452
- }
453
- }
454
- }
451
+ "storageUri" => "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net')]",
452
+ },
453
+ },
454
+ },
455
455
  },
456
456
  {
457
457
  "type" => "Microsoft.Compute/virtualMachines/extensions",
@@ -460,10 +460,10 @@ module Azure::ARM
460
460
  "location" => "[resourceGroup().location]",
461
461
  "copy" => {
462
462
  "name" => "extensionLoop",
463
- "count" => "[parameters('numberOfInstances')]"
463
+ "count" => "[parameters('numberOfInstances')]",
464
464
  },
465
465
  "dependsOn" => [
466
- depExt
466
+ depExt,
467
467
  ],
468
468
  "properties" => {
469
469
  "publisher" => "#{params[:chef_extension_publisher]}",
@@ -479,35 +479,35 @@ module Azure::ARM
479
479
  "node_ssl_verify_mode" => "[parameters('node_ssl_verify_mode')]",
480
480
  "node_verify_api_cert" => "[parameters('node_verify_api_cert')]",
481
481
  "bootstrap_proxy" => "[parameters('bootstrap_proxy')]",
482
- "environment" => "[parameters('environment')]"
482
+ "environment" => "[parameters('environment')]",
483
483
  },
484
484
  "runlist" => "[parameters('runlist')]",
485
485
  "validation_key_format" => "[parameters('validation_key_format')]",
486
486
  "hints" => hints_json,
487
487
  "client_rb" => "[parameters('client_rb')]",
488
- "custom_json_attr" => "[parameters('custom_json_attr')]"
488
+ "custom_json_attr" => "[parameters('custom_json_attr')]",
489
489
  },
490
490
  "protectedSettings" => {
491
491
  "validation_key" => "[parameters('validation_key')]",
492
492
  "chef_server_crt" => "[parameters('chef_server_crt')]",
493
- "encrypted_data_bag_secret" => "[parameters('encrypted_data_bag_secret')]"
494
- }
495
- }
496
- }
497
- ]
493
+ "encrypted_data_bag_secret" => "[parameters('encrypted_data_bag_secret')]",
494
+ },
495
+ },
496
+ },
497
+ ],
498
498
  }
499
499
 
500
500
  if params[:azure_availability_set]
501
501
  set_val = {
502
- "name" => "[parameters('availabilitySetName')]",
503
- "type" => "Microsoft.Compute/availabilitySets",
504
- "apiVersion" => "[variables('apiVersion')]",
505
- "location" => "[resourceGroup().location]",
506
- "properties" => {
507
- "platformFaultDomainCount" => "[parameters('availabilitySetPlatformFaultDomainCount')]",
508
- "platformUpdateDomainCount" => "[parameters('availabilitySetPlatformUpdateDomainCount')]"
509
- }
510
- }
502
+ "name" => "[parameters('availabilitySetName')]",
503
+ "type" => "Microsoft.Compute/availabilitySets",
504
+ "apiVersion" => "[variables('apiVersion')]",
505
+ "location" => "[resourceGroup().location]",
506
+ "properties" => {
507
+ "platformFaultDomainCount" => "[parameters('availabilitySetPlatformFaultDomainCount')]",
508
+ "platformUpdateDomainCount" => "[parameters('availabilitySetPlatformUpdateDomainCount')]",
509
+ },
510
+ }
511
511
 
512
512
  length = template["resources"].length.to_i - 1
513
513
  for i in 0..length do
@@ -560,117 +560,112 @@ module Azure::ARM
560
560
  template["resources"].last["properties"]["protectedSettings"]["client_pem"] = "[parameters(concat('client_pem',copyIndex()))]"
561
561
  0.upto (params[:server_count].to_i - 1) do |count|
562
562
  template["parameters"]["client_pem" + count.to_s] = {
563
- "type" => "string",
564
- "metadata" => {
565
- "description" => "Required for validtorless bootstrap."
566
- }
567
- }
563
+ "type" => "string",
564
+ "metadata" => {
565
+ "description" => "Required for validtorless bootstrap.",
566
+ },
567
+ }
568
568
  end
569
569
  else
570
570
  template["resources"].last["properties"]["protectedSettings"]["client_pem"] = "[parameters('client_pem')]"
571
571
  template["parameters"]["client_pem"] = {
572
- "type" => "string",
573
- "metadata" => {
574
- "description" => "Required for validtorless bootstrap."
575
- }
576
- }
572
+ "type" => "string",
573
+ "metadata" => {
574
+ "description" => "Required for validtorless bootstrap.",
575
+ },
576
+ }
577
577
  end
578
578
  template
579
579
  end
580
580
 
581
- def create_deployment_parameters(params, platform)
582
- if platform == "Windows"
583
- admin_user = params[:winrm_user]
584
- admin_password = params[:admin_password]
585
- else
586
- admin_user = params[:ssh_user]
587
- admin_password = params[:ssh_password]
588
- end
581
+ def create_deployment_parameters(params)
582
+ admin_user = params[:connection_user]
583
+ admin_password = params[:connection_password]
589
584
 
590
585
  parameters = {
591
586
  "adminUserName" => {
592
- "value" => "#{admin_user}"
587
+ "value" => "#{admin_user}",
593
588
  },
594
589
  "adminPassword" => {
595
- "value" => "#{admin_password}"
590
+ "value" => "#{admin_password}",
596
591
  },
597
592
  "availabilitySetName" => {
598
- "value" => "#{params[:azure_availability_set]}"
593
+ "value" => "#{params[:azure_availability_set]}",
599
594
  },
600
595
  "availabilitySetPlatformFaultDomainCount" => {
601
- "value" => "2"
596
+ "value" => "2",
602
597
  },
603
598
  "availabilitySetPlatformUpdateDomainCount" => {
604
- "value" => "5"
599
+ "value" => "5",
605
600
  },
606
601
  "dnsLabelPrefix" => {
607
- "value" => "#{params[:azure_vm_name]}"
602
+ "value" => "#{params[:azure_vm_name]}",
608
603
  },
609
604
  "imageSKU" => {
610
- "value" => "#{params[:azure_image_reference_sku]}"
605
+ "value" => "#{params[:azure_image_reference_sku]}",
611
606
  },
612
607
  "numberOfInstances" => {
613
- "value" => "#{params[:server_count]}".to_i
608
+ "value" => "#{params[:server_count]}".to_i,
614
609
  },
615
610
  "validation_key" => {
616
- "value" => "#{params[:chef_extension_private_param][:validation_key]}"
611
+ "value" => "#{params[:chef_extension_private_param][:validation_key]}",
617
612
  },
618
613
 
619
614
  "chef_server_crt" => {
620
- "value" => "#{params[:chef_extension_private_param][:chef_server_crt]}"
615
+ "value" => "#{params[:chef_extension_private_param][:chef_server_crt]}",
621
616
  },
622
617
  "encrypted_data_bag_secret" => {
623
- "value" => "#{params[:chef_extension_private_param][:encrypted_data_bag_secret]}"
618
+ "value" => "#{params[:chef_extension_private_param][:encrypted_data_bag_secret]}",
624
619
  },
625
620
  "chef_server_url" => {
626
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:chef_server_url]}"
621
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:chef_server_url]}",
627
622
  },
628
623
  "validation_client_name" => {
629
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:validation_client_name]}"
624
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:validation_client_name]}",
630
625
  },
631
626
  "node_ssl_verify_mode" => {
632
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:node_ssl_verify_mode]}"
627
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:node_ssl_verify_mode]}",
633
628
  },
634
629
  "node_verify_api_cert" => {
635
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:node_verify_api_cert]}"
630
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:node_verify_api_cert]}",
636
631
  },
637
632
  "bootstrap_proxy" => {
638
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:bootstrap_proxy]}"
633
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:bootstrap_proxy]}",
639
634
  },
640
635
  "runlist" => {
641
- "value" => "#{params[:chef_extension_public_param][:runlist]}"
636
+ "value" => "#{params[:chef_extension_public_param][:runlist]}",
642
637
  },
643
638
  "environment" => {
644
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:environment]}"
639
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:environment]}",
645
640
  },
646
641
  "chef_node_name" => {
647
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:chef_node_name]}"
642
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:chef_node_name]}",
648
643
  },
649
644
  "client_rb" => {
650
- "value" => "#{params[:chef_extension_public_param][:client_rb]}"
645
+ "value" => "#{params[:chef_extension_public_param][:client_rb]}",
651
646
  },
652
647
  "bootstrap_version" => {
653
- "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:bootstrap_version]}"
648
+ "value" => "#{params[:chef_extension_public_param][:bootstrap_options][:bootstrap_version]}",
654
649
  },
655
650
  "custom_json_attr" => {
656
- "value" => "#{params[:chef_extension_public_param][:custom_json_attr]}"
651
+ "value" => "#{params[:chef_extension_public_param][:custom_json_attr]}",
657
652
  },
658
653
  "sshKeyData" => {
659
- "value" => "#{params[:ssh_key]}"
654
+ "value" => "#{params[:ssh_public_key]}",
660
655
  },
661
656
  "disablePasswordAuthentication" => {
662
- "value" => "#{params[:disablePasswordAuthentication]}"
663
- }
657
+ "value" => "#{params[:disablePasswordAuthentication]}",
658
+ },
664
659
  }
665
660
  if params[:server_count].to_i > 1 && params[:chef_extension_private_param][:validation_key].nil?
666
661
  0.upto (params[:server_count].to_i - 1) do |count|
667
662
  parameters["client_pem#{count}"] = {
668
- "value" => "#{params[:chef_extension_private_param][("client_pem" + count.to_s).to_sym]}"
663
+ "value" => "#{params[:chef_extension_private_param][("client_pem" + count.to_s).to_sym]}",
669
664
  }
670
665
  end
671
666
  else
672
667
  parameters["client_pem"] = {
673
- "value" => "#{params[:chef_extension_private_param][:client_pem]}"
668
+ "value" => "#{params[:chef_extension_private_param][:client_pem]}",
674
669
  }
675
670
  end
676
671
  parameters