wombat-cli 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/generator_files/cookbooks/wombat/attributes/default.rb +1 -1
  4. data/generator_files/cookbooks/wombat/metadata.rb +1 -1
  5. data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +1 -1
  6. data/generator_files/cookbooks/workstation/libraries/home.rb +4 -0
  7. data/generator_files/cookbooks/workstation/metadata.rb +1 -1
  8. data/generator_files/cookbooks/workstation/recipes/browser.rb +0 -1
  9. data/generator_files/cookbooks/workstation/recipes/certs-keys.rb +1 -1
  10. data/generator_files/cookbooks/workstation/recipes/chef.rb +0 -1
  11. data/generator_files/cookbooks/workstation/recipes/default.rb +5 -5
  12. data/generator_files/cookbooks/workstation/recipes/editor.rb +2 -3
  13. data/generator_files/cookbooks/workstation/recipes/profile.rb +6 -7
  14. data/generator_files/cookbooks/workstation/recipes/terminal.rb +0 -2
  15. data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +1 -1
  16. data/generator_files/packer/automate.json +8 -3
  17. data/generator_files/packer/build-node.json +8 -3
  18. data/generator_files/packer/chef-server.json +8 -3
  19. data/generator_files/packer/compliance.json +8 -3
  20. data/generator_files/packer/infranodes-windows.json +8 -3
  21. data/generator_files/packer/infranodes.json +8 -3
  22. data/generator_files/packer/workstation.json +8 -3
  23. data/generator_files/templates/arm.md.json.erb +755 -0
  24. data/generator_files/templates/{arm.json.erb → arm.vhd.json.erb} +62 -7
  25. data/generator_files/templates/bootstrap-aws.erb +3 -0
  26. data/generator_files/wombat.yml +3 -0
  27. data/lib/wombat/build.rb +101 -5
  28. data/lib/wombat/common.rb +26 -3
  29. data/lib/wombat/version.rb +1 -1
  30. data/wombat-cli.gemspec +1 -0
  31. metadata +19 -3
@@ -0,0 +1,755 @@
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.1",
4
+ "parameters": {
5
+
6
+ "demoName": {
7
+ "metadata": {
8
+ "description": "Name of the customer or organization"
9
+ },
10
+ "type": "string",
11
+ "defaultValue": "<%= @demo %>"
12
+ },
13
+
14
+ "storageAccountName": {
15
+ "type": "string",
16
+ "metadata": {
17
+ "description": "Name of the storage account that should be used to store the machine disks"
18
+ },
19
+ "defaultValue": "<%= @storage_account %>"
20
+ },
21
+
22
+ "adminPassword": {
23
+ "type": "string",
24
+ "metadata": {
25
+ "description": "Password associated with the specified user"
26
+ },
27
+ "defaultValue": "<%= @password %>"
28
+ },
29
+
30
+ "shortUniqueLength": {
31
+ "type": "int",
32
+ "metadata": {
33
+ "description": "Number of characters to be take from the unique string to make a short unique string"
34
+ },
35
+ "defaultValue": 4
36
+ }
37
+
38
+ },
39
+ "variables": {
40
+
41
+ "unique": "[uniqueString(subscription().subscriptionId, resourceGroup().id, deployment().name)]",
42
+ "uniqueShort": "[substring(variables('unique'), 0, parameters('shortUniqueLength'))]",
43
+
44
+ "location": "[resourceGroup().location]",
45
+
46
+ "sa": {
47
+ "name": "[parameters('storageAccountName')]",
48
+ "container": "[concat('vhds-', variables('unique'))]",
49
+ "type": "Standard_LRS"
50
+ },
51
+
52
+ "tagvalues": {
53
+ "provider": "<%= @chef_tag %>"
54
+ },
55
+
56
+ "network": {
57
+ "virtual": {
58
+ "name": "ChefAutomate-VNET",
59
+ "addressPrefix": "172.31.54.0/24"
60
+ },
61
+ "subnet": {
62
+ "name": "ChefAutomate-Subnet",
63
+ "addressPrefix": "172.31.54.0/24"
64
+ },
65
+ "ipAddresses": {
66
+ "chef": {
67
+ "internal": {
68
+ "address": "172.31.54.10",
69
+ "allocationMethod": "static"
70
+ }
71
+ },
72
+ "automate": {
73
+ "internal": {
74
+ "address": "172.31.54.11",
75
+ "allocationMethod": "static"
76
+ }
77
+ },
78
+ "compliance": {
79
+ "internal": {
80
+ "address": "172.31.54.12",
81
+ "allocationMethod": "static"
82
+ }
83
+ },
84
+ "workstation": {
85
+ "internal": {
86
+ "addressPrefix": "172.31.54.",
87
+ "allocationMethod": "static"
88
+ },
89
+ "external": {
90
+ "domainNameLabel": "[concat('ws-', variables('uniqueShort'))]",
91
+ "allocationMethod": "dynamic"
92
+ }
93
+ },
94
+ "buildnode": {
95
+ "internal": {
96
+ "addressPrefix": "172.31.54.",
97
+ "allocationMethod": "static"
98
+ }
99
+ },
100
+ "infranode": {
101
+ "internal": {
102
+ "addressPrefix": "172.31.54.",
103
+ "allocationMethod": "static"
104
+ }
105
+ }
106
+ }
107
+ },
108
+
109
+ "customData": "#cloud-config\nmanage_etc_hosts: false\n\npackage_update: false"
110
+ },
111
+ "resources": [
112
+
113
+ {
114
+ "type": "Microsoft.Network/virtualNetworks",
115
+ "name": "[variables('network').virtual.name]",
116
+ "apiVersion": "2015-06-15",
117
+ "location": "[variables('location')]",
118
+ "tags": {
119
+ "provider": "[variables('tagvalues').provider]"
120
+ },
121
+ "properties": {
122
+ "addressSpace": {
123
+ "addressPrefixes": [
124
+ "[variables('network').virtual.addressPrefix]"
125
+ ]
126
+ },
127
+ "subnets": [
128
+ {
129
+ "name": "[variables('network').subnet.name]",
130
+ "properties": {
131
+ "addressPrefix": "[variables('network').subnet.addressPrefix]"
132
+ }
133
+ }
134
+ ]
135
+ }
136
+ },
137
+
138
+
139
+
140
+ <% 1.upto(@workstations) do |i| -%>
141
+
142
+ {
143
+ "type": "Microsoft.Network/publicIPAddresses",
144
+ "name": "Workstation-<%= i.to_s %>-PublicIPAddress",
145
+ "apiVersion": "2015-06-15",
146
+ "location": "[variables('location')]",
147
+ "tags": {
148
+ "provider": "[variables('tagvalues').provider]"
149
+ },
150
+ "properties": {
151
+ "publicIPAllocationMethod": "[variables('network').ipAddresses.workstation.external.allocationMethod]",
152
+ "dnsSettings": {
153
+ "domainNameLabel": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]"
154
+ }
155
+ }
156
+ },
157
+
158
+ {
159
+ "type": "Microsoft.Network/networkInterfaces",
160
+ "name": "Workstation-<%= i.to_s %>-NIC",
161
+ "apiVersion": "2015-06-15",
162
+ "location": "[variables('location')]",
163
+ "tags": {
164
+ "provider": "[variables('tagvalues').provider]"
165
+ },
166
+ "dependsOn": [
167
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]",
168
+ "Microsoft.Network/publicIPAddresses/Workstation-<%= i.to_s %>-PublicIPAddress"
169
+ ],
170
+ "properties": {
171
+ "ipConfigurations": [
172
+ {
173
+ "name": "ipconfig1",
174
+ "properties": {
175
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.workstation.internal.allocationMethod]",
176
+ "privateIPAddress": "[concat(variables('network').ipAddresses.workstation.internal.addressPrefix, '<%= 200 + i %>')]",
177
+ "publicIPAddress": {
178
+ "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'Workstation-<%= i.to_s %>-PublicIPAddress')]"
179
+ },
180
+ "subnet": {
181
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
182
+ }
183
+ }
184
+ }
185
+ ]
186
+ }
187
+ },
188
+
189
+ {
190
+ "type": "Microsoft.Compute/images",
191
+ "apiVersion": "2016-04-30-preview",
192
+ "name": "Workstation-<%= i.to_s %>-VM-Image",
193
+ "location": "[variables('location')]",
194
+ "tags": {
195
+ "provider": "[variables('tagvalues').provider]"
196
+ },
197
+ "properties": {
198
+ "storageProfile": {
199
+ "osDisk": {
200
+ "osType": "Windows",
201
+ "blobUri": "<%= @workstation_ami[i] %>",
202
+ "caching": "ReadWrite",
203
+ "storageAccountType": "Standard_LRS"
204
+ },
205
+ "dataDisks": []
206
+ }
207
+ }
208
+ },
209
+
210
+ {
211
+ "type": "Microsoft.Compute/virtualMachines",
212
+ "name": "Workstation-<%= i.to_s %>-VM",
213
+ "apiVersion": "2016-04-30-preview",
214
+ "location": "[variables('location')]",
215
+ "tags": {
216
+ "provider": "[variables('tagvalues').provider]"
217
+ },
218
+ "dependsOn": [
219
+ "Microsoft.Network/networkInterfaces/Workstation-<%= i.to_s %>-NIC",
220
+ "Microsoft.Compute/images/Workstation-<%= i.to_s %>-VM-Image"
221
+ ],
222
+ "tags": {
223
+ "name": "[concat(parameters('demoName'), ' Workstation <%= i.to_s %>')]"
224
+ },
225
+ "properties": {
226
+ "hardwareProfile": {
227
+ "vmSize": "Standard_DS2_v2"
228
+ },
229
+ "osProfile": {
230
+ "computerName": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]",
231
+ "adminUsername": "chef",
232
+ "adminPassword": "[parameters('adminPassword')]"
233
+ },
234
+ "storageProfile": {
235
+ "imageReference": {
236
+ "id": "[resourceId('Microsoft.Compute/images', 'Workstation-<%= i.to_s %>-VM-Image')]"
237
+ }
238
+ },
239
+ "networkProfile": {
240
+ "networkInterfaces": [
241
+ {
242
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'Workstation-<%= i.to_s %>-NIC')]"
243
+ }
244
+ ]
245
+ }
246
+ }
247
+ },
248
+
249
+ <% end %>
250
+
251
+ <% 1.upto(@build_nodes) do |i| -%>
252
+
253
+ {
254
+ "type": "Microsoft.Network/networkInterfaces",
255
+ "name": "BuildNode-<%= i.to_s %>-NIC",
256
+ "apiVersion": "2015-06-15",
257
+ "location": "[variables('location')]",
258
+ "tags": {
259
+ "provider": "[variables('tagvalues').provider]"
260
+ },
261
+ "dependsOn": [
262
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
263
+ ],
264
+ "properties": {
265
+ "ipConfigurations": [
266
+ {
267
+ "name": "ipconfig1",
268
+ "properties": {
269
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.buildnode.internal.allocationMethod]",
270
+ "privateIPAddress": "[concat(variables('network').ipAddresses.buildnode.internal.addressPrefix, '<%= 50 + i %>')]",
271
+ "subnet": {
272
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
273
+ }
274
+ }
275
+ }
276
+ ]
277
+ }
278
+ },
279
+
280
+ {
281
+ "type": "Microsoft.Compute/images",
282
+ "apiVersion": "2016-04-30-preview",
283
+ "name": "BuildNode-<%= i.to_s %>-VM-Image",
284
+ "location": "[variables('location')]",
285
+ "tags": {
286
+ "provider": "[variables('tagvalues').provider]"
287
+ },
288
+ "properties": {
289
+ "storageProfile": {
290
+ "osDisk": {
291
+ "osType": "Linux",
292
+ "blobUri": "<%= @build_node_ami[i] %>",
293
+ "caching": "ReadWrite",
294
+ "storageAccountType": "Standard_LRS"
295
+ },
296
+ "dataDisks": []
297
+ }
298
+ }
299
+ },
300
+
301
+ {
302
+ "type": "Microsoft.Compute/virtualMachines",
303
+ "name": "BuildNode-<%= i.to_s %>-VM",
304
+ "apiVersion": "2016-04-30-preview",
305
+ "location": "[variables('location')]",
306
+ "tags": {
307
+ "provider": "[variables('tagvalues').provider]"
308
+ },
309
+ "dependsOn": [
310
+ "Microsoft.Network/networkInterfaces/BuildNode-<%= i.to_s %>-NIC",
311
+ "Microsoft.Compute/images/BuildNode-<%= i.to_s %>-VM-Image"
312
+ ],
313
+ "tags": {
314
+ "name": "[concat(parameters('demoName'), ' Build Node <%= i.to_s %>')]"
315
+ },
316
+ "properties": {
317
+ "hardwareProfile": {
318
+ "vmSize": "Standard_DS2_v2"
319
+ },
320
+ "osProfile": {
321
+ "computerName": "build-node-<%= i.to_s %>",
322
+ "adminUsername": "ubuntu",
323
+ "adminPassword": "[parameters('adminPassword')]",
324
+ "linuxConfiguration": {
325
+ "disablePasswordAuthentication": "true",
326
+ "ssh": {
327
+ "publicKeys": [
328
+ {
329
+ "path": "/home/ubuntu/.ssh/authorized_keys",
330
+ "keyData": "<%= @public_key -%>"
331
+ }
332
+ ]
333
+ }
334
+ }
335
+ },
336
+ "storageProfile": {
337
+ "imageReference": {
338
+ "id": "[resourceId('Microsoft.Compute/images', 'BuildNode-<%= i.to_s %>-VM-Image')]"
339
+ }
340
+ },
341
+ "networkProfile": {
342
+ "networkInterfaces": [
343
+ {
344
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'BuildNode-<%= i.to_s %>-NIC')]"
345
+ }
346
+ ]
347
+ }
348
+ }
349
+ },
350
+
351
+ <% end %>
352
+
353
+ <% @infra.sort.each do |name, _uri| -%>
354
+
355
+ {
356
+ "type": "Microsoft.Network/networkInterfaces",
357
+ "name": "InfraNode-<%= name %>-NIC",
358
+ "apiVersion": "2015-06-15",
359
+ "location": "[variables('location')]",
360
+ "tags": {
361
+ "provider": "[variables('tagvalues').provider]"
362
+ },
363
+ "dependsOn": [
364
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
365
+ ],
366
+ "properties": {
367
+ "ipConfigurations": [
368
+ {
369
+ "name": "ipconfig1",
370
+ "properties": {
371
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.infranode.internal.allocationMethod]",
372
+ "privateIPAddress": "[concat(variables('network').ipAddresses.infranode.internal.addressPrefix, '<%= 101 + @infra.keys.find_index(name) %>')]",
373
+ "subnet": {
374
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
375
+ }
376
+ }
377
+ }
378
+ ]
379
+ }
380
+ },
381
+
382
+ {
383
+ "type": "Microsoft.Compute/images",
384
+ "apiVersion": "2016-04-30-preview",
385
+ "name": "InfraNode-<%= name %>-VM-Image",
386
+ "location": "[variables('location')]",
387
+ "tags": {
388
+ "provider": "[variables('tagvalues').provider]"
389
+ },
390
+ "properties": {
391
+ "storageProfile": {
392
+ "osDisk": {
393
+ "osType": "Linux",
394
+ "blobUri": "<%= _uri %>",
395
+ "caching": "ReadWrite",
396
+ "storageAccountType": "Standard_LRS"
397
+ },
398
+ "dataDisks": []
399
+ }
400
+ }
401
+ },
402
+
403
+ {
404
+ "type": "Microsoft.Compute/virtualMachines",
405
+ "name": "InfraNode-<%= name %>-VM",
406
+ "apiVersion": "2016-04-30-preview",
407
+ "location": "[variables('location')]",
408
+ "tags": {
409
+ "provider": "[variables('tagvalues').provider]"
410
+ },
411
+ "dependsOn": [
412
+ "Microsoft.Network/networkInterfaces/InfraNode-<%= name %>-NIC",
413
+ "Microsoft.Compute/images/InfraNode-<%= name %>-VM-Image"
414
+ ],
415
+ "tags": {
416
+ "name": "[concat(parameters('demoName'), ' Infra Node - <%= name %>')]"
417
+ },
418
+ "properties": {
419
+ "hardwareProfile": {
420
+ "vmSize": "Standard_DS2_v2"
421
+ },
422
+ "osProfile": {
423
+ "computerName": "<%= name %>",
424
+ "adminUsername": "ubuntu",
425
+ "adminPassword": "[parameters('adminPassword')]",
426
+ "linuxConfiguration": {
427
+ "disablePasswordAuthentication": "true",
428
+ "ssh": {
429
+ "publicKeys": [
430
+ {
431
+ "path": "/home/ubuntu/.ssh/authorized_keys",
432
+ "keyData": "<%= @public_key -%>"
433
+ }
434
+ ]
435
+ }
436
+ }
437
+ },
438
+ "storageProfile": {
439
+ "imageReference": {
440
+ "id": "[resourceId('Microsoft.Compute/images', 'InfraNode-<%= name %>-VM-Image')]"
441
+ }
442
+ },
443
+ "networkProfile": {
444
+ "networkInterfaces": [
445
+ {
446
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'InfraNode-<%= name %>-NIC')]"
447
+ }
448
+ ]
449
+ }
450
+ }
451
+ },
452
+
453
+ <% end %>
454
+
455
+ {
456
+ "type": "Microsoft.Network/networkInterfaces",
457
+ "name": "ChefServer-NIC",
458
+ "apiVersion": "2015-06-15",
459
+ "location": "[variables('location')]",
460
+ "tags": {
461
+ "provider": "[variables('tagvalues').provider]"
462
+ },
463
+ "dependsOn": [
464
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
465
+ ],
466
+ "properties": {
467
+ "ipConfigurations": [
468
+ {
469
+ "name": "ipconfig1",
470
+ "properties": {
471
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.chef.internal.allocationMethod]",
472
+ "privateIPAddress": "[variables('network').ipAddresses.chef.internal.address]",
473
+ "subnet": {
474
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
475
+ }
476
+ }
477
+ }
478
+ ]
479
+ }
480
+ },
481
+
482
+ {
483
+ "type": "Microsoft.Compute/images",
484
+ "apiVersion": "2016-04-30-preview",
485
+ "name": "ChefServer-VM-Image",
486
+ "location": "[variables('location')]",
487
+ "tags": {
488
+ "provider": "[variables('tagvalues').provider]"
489
+ },
490
+ "properties": {
491
+ "storageProfile": {
492
+ "osDisk": {
493
+ "osType": "Linux",
494
+ "blobUri": "<%= @chef_server_uri %>",
495
+ "caching": "ReadWrite",
496
+ "storageAccountType": "Standard_LRS"
497
+ },
498
+ "dataDisks": []
499
+ }
500
+ }
501
+ },
502
+
503
+ {
504
+ "type": "Microsoft.Compute/virtualMachines",
505
+ "name": "ChefServer-VM",
506
+ "apiVersion": "2016-04-30-preview",
507
+ "location": "[variables('location')]",
508
+ "tags": {
509
+ "provider": "[variables('tagvalues').provider]"
510
+ },
511
+ "dependsOn": [
512
+ "Microsoft.Network/networkInterfaces/ChefServer-NIC",
513
+ "Microsoft.Compute/images/ChefServer-VM-Image"
514
+ ],
515
+ "tags": {
516
+ "name": "[concat(parameters('demoName'), ' Chef Server')]"
517
+ },
518
+ "properties": {
519
+ "hardwareProfile": {
520
+ "vmSize": "Standard_F4s"
521
+ },
522
+ "osProfile": {
523
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
524
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname chef\n - chef-server-ctl reconfigure'))]",
525
+ "adminUsername": "ubuntu",
526
+ "adminPassword": "[parameters('adminPassword')]",
527
+ "linuxConfiguration": {
528
+ "disablePasswordAuthentication": "true",
529
+ "ssh": {
530
+ "publicKeys": [
531
+ {
532
+ "path": "/home/ubuntu/.ssh/authorized_keys",
533
+ "keyData": "<%= @public_key -%>"
534
+ }
535
+ ]
536
+ }
537
+ }
538
+ },
539
+ "storageProfile": {
540
+ "imageReference": {
541
+ "id": "[resourceId('Microsoft.Compute/images', 'ChefServer-VM-Image')]"
542
+ }
543
+ },
544
+ "networkProfile": {
545
+ "networkInterfaces": [
546
+ {
547
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ChefServer-NIC')]"
548
+ }
549
+ ]
550
+ }
551
+ }
552
+ },
553
+
554
+ {
555
+ "type": "Microsoft.Network/networkInterfaces",
556
+ "name": "AutomateServer-NIC",
557
+ "apiVersion": "2015-06-15",
558
+ "location": "[variables('location')]",
559
+ "tags": {
560
+ "provider": "[variables('tagvalues').provider]"
561
+ },
562
+ "dependsOn": [
563
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
564
+ ],
565
+ "properties": {
566
+ "ipConfigurations": [
567
+ {
568
+ "name": "ipconfig1",
569
+ "properties": {
570
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.automate.internal.allocationMethod]",
571
+ "privateIPAddress": "[variables('network').ipAddresses.automate.internal.address]",
572
+ "subnet": {
573
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
574
+ }
575
+ }
576
+ }
577
+ ]
578
+ }
579
+ },
580
+
581
+ {
582
+ "type": "Microsoft.Compute/images",
583
+ "apiVersion": "2016-04-30-preview",
584
+ "name": "AutomateServer-VM-Image",
585
+ "location": "[variables('location')]",
586
+ "tags": {
587
+ "provider": "[variables('tagvalues').provider]"
588
+ },
589
+ "properties": {
590
+ "storageProfile": {
591
+ "osDisk": {
592
+ "osType": "Linux",
593
+ "blobUri": "<%= @automate_uri %>",
594
+ "caching": "ReadWrite",
595
+ "storageAccountType": "Standard_LRS"
596
+ },
597
+ "dataDisks": []
598
+ }
599
+ }
600
+ },
601
+
602
+ {
603
+ "type": "Microsoft.Compute/virtualMachines",
604
+ "name": "AutomateServer-VM",
605
+ "apiVersion": "2016-04-30-preview",
606
+ "location": "[variables('location')]",
607
+ "tags": {
608
+ "provider": "[variables('tagvalues').provider]"
609
+ },
610
+ "dependsOn": [
611
+ "Microsoft.Network/networkInterfaces/AutomateServer-NIC",
612
+ "Microsoft.Compute/images/AutomateServer-VM-Image"
613
+ ],
614
+ "tags": {
615
+ "name": "[concat(parameters('demoName'), ' Automate Server')]"
616
+ },
617
+ "properties": {
618
+ "hardwareProfile": {
619
+ "vmSize": "Standard_F4s"
620
+ },
621
+ "osProfile": {
622
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
623
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname automate\n - chef-server-ctl reconfigure'))]",
624
+ "adminUsername": "ubuntu",
625
+ "adminPassword": "[parameters('adminPassword')]",
626
+ "linuxConfiguration": {
627
+ "disablePasswordAuthentication": "true",
628
+ "ssh": {
629
+ "publicKeys": [
630
+ {
631
+ "path": "/home/ubuntu/.ssh/authorized_keys",
632
+ "keyData": "<%= @public_key -%>"
633
+ }
634
+ ]
635
+ }
636
+ }
637
+ },
638
+ "storageProfile": {
639
+ "imageReference": {
640
+ "id": "[resourceId('Microsoft.Compute/images', 'AutomateServer-VM-Image')]"
641
+ }
642
+ },
643
+ "networkProfile": {
644
+ "networkInterfaces": [
645
+ {
646
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'AutomateServer-NIC')]"
647
+ }
648
+ ]
649
+ }
650
+ }
651
+ },
652
+
653
+ {
654
+ "type": "Microsoft.Network/networkInterfaces",
655
+ "name": "ComplianceServer-NIC",
656
+ "apiVersion": "2015-06-15",
657
+ "location": "[variables('location')]",
658
+ "tags": {
659
+ "provider": "[variables('tagvalues').provider]"
660
+ },
661
+ "dependsOn": [
662
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
663
+ ],
664
+ "properties": {
665
+ "ipConfigurations": [
666
+ {
667
+ "name": "ipconfig1",
668
+ "properties": {
669
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.compliance.internal.allocationMethod]",
670
+ "privateIPAddress": "[variables('network').ipAddresses.compliance.internal.address]",
671
+ "subnet": {
672
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
673
+ }
674
+ }
675
+ }
676
+ ]
677
+ }
678
+ },
679
+
680
+ {
681
+ "type": "Microsoft.Compute/images",
682
+ "apiVersion": "2016-04-30-preview",
683
+ "name": "ComplianceServer-VM-Image",
684
+ "location": "[variables('location')]",
685
+ "tags": {
686
+ "provider": "[variables('tagvalues').provider]"
687
+ },
688
+ "properties": {
689
+ "storageProfile": {
690
+ "osDisk": {
691
+ "osType": "Linux",
692
+ "blobUri": "<%= @compliance_uri %>",
693
+ "caching": "ReadWrite",
694
+ "storageAccountType": "Standard_LRS"
695
+ },
696
+ "dataDisks": []
697
+ }
698
+ }
699
+ },
700
+
701
+ {
702
+ "type": "Microsoft.Compute/virtualMachines",
703
+ "name": "ComplianceServer-VM",
704
+ "apiVersion": "2016-04-30-preview",
705
+ "location": "[variables('location')]",
706
+ "tags": {
707
+ "provider": "[variables('tagvalues').provider]"
708
+ },
709
+ "dependsOn": [
710
+ "Microsoft.Network/networkInterfaces/ComplianceServer-NIC",
711
+ "Microsoft.Compute/images/ComplianceServer-VM-Image"
712
+ ],
713
+ "tags": {
714
+ "name": "[concat(parameters('demoName'), ' Compliance Server')]"
715
+ },
716
+ "properties": {
717
+ "hardwareProfile": {
718
+ "vmSize": "Standard_F4s"
719
+ },
720
+ "osProfile": {
721
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
722
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname compliance\n - compliance-ctl reconfigure'))]",
723
+ "adminUsername": "ubuntu",
724
+ "adminPassword": "[parameters('adminPassword')]",
725
+ "linuxConfiguration": {
726
+ "disablePasswordAuthentication": "true",
727
+ "ssh": {
728
+ "publicKeys": [
729
+ {
730
+ "path": "/home/ubuntu/.ssh/authorized_keys",
731
+ "keyData": "<%= @public_key -%>"
732
+ }
733
+ ]
734
+ }
735
+ }
736
+ },
737
+ "storageProfile": {
738
+ "imageReference": {
739
+ "id": "[resourceId('Microsoft.Compute/images', 'ComplianceServer-VM-Image')]"
740
+ }
741
+ },
742
+ "networkProfile": {
743
+ "networkInterfaces": [
744
+ {
745
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ComplianceServer-NIC')]"
746
+ }
747
+ ]
748
+ }
749
+ }
750
+ }
751
+ ],
752
+ "outputs": {
753
+
754
+ }
755
+ }