wombat-cli 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +23 -23
  3. data/.travis.yml +22 -27
  4. data/CHANGELOG.md +438 -423
  5. data/DESIGN.md +49 -49
  6. data/Gemfile +5 -5
  7. data/README.md +146 -146
  8. data/Rakefile +26 -26
  9. data/bin/wombat +24 -24
  10. data/generator_files/Vagrantfile +120 -120
  11. data/generator_files/cookbooks/automate/.gitignore +16 -16
  12. data/generator_files/cookbooks/automate/.kitchen.ec2.yml +34 -34
  13. data/generator_files/cookbooks/automate/.kitchen.yml +24 -24
  14. data/generator_files/cookbooks/automate/Berksfile +6 -6
  15. data/generator_files/cookbooks/automate/README.md +4 -4
  16. data/generator_files/cookbooks/automate/chefignore +102 -102
  17. data/generator_files/cookbooks/automate/libraries/_helper.rb +52 -52
  18. data/generator_files/cookbooks/automate/libraries/delivery_api.rb +204 -204
  19. data/generator_files/cookbooks/automate/libraries/delivery_project.rb +31 -31
  20. data/generator_files/cookbooks/automate/libraries/dsl.rb +4 -4
  21. data/generator_files/cookbooks/automate/metadata.rb +11 -11
  22. data/generator_files/cookbooks/automate/recipes/default.rb +118 -124
  23. data/generator_files/cookbooks/automate/recipes/update-users.rb +48 -48
  24. data/generator_files/cookbooks/automate/templates/delivery.erb +6 -6
  25. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  26. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  27. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
  28. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  29. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  30. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  31. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  32. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  33. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
  34. data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
  35. data/generator_files/cookbooks/automate/test/integration/default/automate_spec.rb +56 -56
  36. data/generator_files/cookbooks/build_node/.gitignore +16 -16
  37. data/generator_files/cookbooks/build_node/.kitchen.ec2.yml +37 -37
  38. data/generator_files/cookbooks/build_node/.kitchen.yml +23 -23
  39. data/generator_files/cookbooks/build_node/Berksfile +8 -8
  40. data/generator_files/cookbooks/build_node/README.md +4 -4
  41. data/generator_files/cookbooks/build_node/chefignore +102 -102
  42. data/generator_files/cookbooks/build_node/metadata.rb +12 -12
  43. data/generator_files/cookbooks/build_node/recipes/default.rb +38 -38
  44. data/generator_files/cookbooks/build_node/templates/client.erb +2 -2
  45. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  46. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  47. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
  48. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  49. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  50. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  51. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  52. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  53. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
  54. data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/recipes/default.rb +18 -18
  55. data/generator_files/cookbooks/build_node/test/integration/default/build-node_spec.rb +40 -40
  56. data/generator_files/cookbooks/chef_server/.gitignore +16 -16
  57. data/generator_files/cookbooks/chef_server/.kitchen.ec2.yml +34 -34
  58. data/generator_files/cookbooks/chef_server/.kitchen.yml +24 -24
  59. data/generator_files/cookbooks/chef_server/Berksfile +6 -6
  60. data/generator_files/cookbooks/chef_server/README.md +4 -4
  61. data/generator_files/cookbooks/chef_server/chefignore +102 -102
  62. data/generator_files/cookbooks/chef_server/metadata.rb +11 -11
  63. data/generator_files/cookbooks/chef_server/recipes/bootstrap_users.rb +91 -91
  64. data/generator_files/cookbooks/chef_server/recipes/default.rb +113 -113
  65. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  66. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  67. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
  68. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  69. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  70. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  71. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  72. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  73. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
  74. data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/recipes/default.rb +23 -23
  75. data/generator_files/cookbooks/chef_server/test/integration/default/chef_server_spec.rb +50 -50
  76. data/generator_files/cookbooks/compliance/.gitignore +16 -16
  77. data/generator_files/cookbooks/compliance/.kitchen.ec2.yml +34 -34
  78. data/generator_files/cookbooks/compliance/.kitchen.yml +24 -24
  79. data/generator_files/cookbooks/compliance/Berksfile +7 -7
  80. data/generator_files/cookbooks/compliance/README.md +4 -4
  81. data/generator_files/cookbooks/compliance/chefignore +102 -102
  82. data/generator_files/cookbooks/compliance/metadata.rb +11 -11
  83. data/generator_files/cookbooks/compliance/recipes/default.rb +57 -57
  84. data/generator_files/cookbooks/compliance/spec/spec_helper.rb +2 -2
  85. data/generator_files/cookbooks/compliance/spec/unit/recipes/default_spec.rb +20 -20
  86. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  87. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  88. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
  89. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  90. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  91. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  92. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  93. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  94. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/metadata.rb +4 -4
  95. data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
  96. data/generator_files/cookbooks/compliance/test/integration/default/compliance.rb +28 -28
  97. data/generator_files/cookbooks/infranodes/.gitignore +16 -16
  98. data/generator_files/cookbooks/infranodes/.kitchen.ec2.yml +48 -48
  99. data/generator_files/cookbooks/infranodes/.kitchen.yml +21 -21
  100. data/generator_files/cookbooks/infranodes/Berksfile +6 -6
  101. data/generator_files/cookbooks/infranodes/README.md +4 -4
  102. data/generator_files/cookbooks/infranodes/attributes/default.rb +2 -2
  103. data/generator_files/cookbooks/infranodes/chefignore +102 -102
  104. data/generator_files/cookbooks/infranodes/metadata.rb +13 -13
  105. data/generator_files/cookbooks/infranodes/recipes/default.rb +57 -57
  106. data/generator_files/cookbooks/infranodes/spec/spec_helper.rb +2 -2
  107. data/generator_files/cookbooks/infranodes/spec/unit/recipes/default_spec.rb +20 -20
  108. data/generator_files/cookbooks/infranodes/templates/default/client.rb.erb +5 -5
  109. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  110. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  111. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
  112. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  113. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  114. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  115. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  116. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  117. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
  118. data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
  119. data/generator_files/cookbooks/infranodes/test/integration/default/infranodes_spec.rb +22 -22
  120. data/generator_files/cookbooks/infranodes/test/integration/helpers/serverspec/spec_helper.rb +8 -8
  121. data/generator_files/cookbooks/wombat/.gitignore +16 -16
  122. data/generator_files/cookbooks/wombat/.kitchen.yml +43 -43
  123. data/generator_files/cookbooks/wombat/Berksfile +5 -5
  124. data/generator_files/cookbooks/wombat/README.md +4 -4
  125. data/generator_files/cookbooks/wombat/attributes/default.rb +79 -80
  126. data/generator_files/cookbooks/wombat/attributes/packer.rb +18 -18
  127. data/generator_files/cookbooks/wombat/chefignore +102 -102
  128. data/generator_files/cookbooks/wombat/metadata.rb +13 -13
  129. data/generator_files/cookbooks/wombat/recipes/authorized-keys.rb +20 -20
  130. data/generator_files/cookbooks/wombat/recipes/default.rb +111 -111
  131. data/generator_files/cookbooks/wombat/recipes/etc-hosts.rb +51 -51
  132. data/generator_files/cookbooks/workstation/.gitignore +16 -16
  133. data/generator_files/cookbooks/workstation/.kitchen.azure.yml +45 -0
  134. data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +46 -30
  135. data/generator_files/cookbooks/workstation/.kitchen.yml +42 -22
  136. data/generator_files/cookbooks/workstation/Berksfile +7 -7
  137. data/generator_files/cookbooks/workstation/README.md +3 -3
  138. data/generator_files/cookbooks/workstation/chefignore +106 -102
  139. data/generator_files/cookbooks/workstation/files/atom.apm.list +10 -7
  140. data/generator_files/cookbooks/workstation/files/atom.config.cson +6 -3
  141. data/generator_files/cookbooks/workstation/{templates/default/ise_profile.ps1.erb → files/ise_profile.ps1} +11 -11
  142. data/generator_files/cookbooks/workstation/libraries/home.rb +4 -4
  143. data/generator_files/cookbooks/workstation/metadata.rb +14 -14
  144. data/generator_files/cookbooks/workstation/recipes/browser.rb +53 -58
  145. data/generator_files/cookbooks/workstation/recipes/certs-keys.rb +41 -45
  146. data/generator_files/cookbooks/workstation/recipes/chef.rb +29 -28
  147. data/generator_files/cookbooks/workstation/recipes/default.rb +24 -21
  148. data/generator_files/cookbooks/workstation/recipes/dotnet.rb +19 -17
  149. data/generator_files/cookbooks/workstation/recipes/editor.rb +46 -18
  150. data/generator_files/cookbooks/workstation/recipes/profile.rb +14 -41
  151. data/generator_files/cookbooks/workstation/recipes/terminal.rb +11 -11
  152. data/generator_files/cookbooks/workstation/templates/default/bookmarks.html.erb +23 -23
  153. data/generator_files/cookbooks/workstation/templates/default/data_collector.rb.erb +2 -2
  154. data/generator_files/cookbooks/workstation/templates/default/knife.rb.erb +10 -10
  155. data/generator_files/cookbooks/workstation/templates/default/master_preferences.json.erb +28 -28
  156. data/generator_files/cookbooks/workstation/templates/default/ssh_config.erb +16 -16
  157. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
  158. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
  159. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.crt +26 -26
  160. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
  161. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
  162. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
  163. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
  164. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
  165. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
  166. data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
  167. data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +77 -37
  168. data/generator_files/packer/automate.json +136 -136
  169. data/generator_files/packer/build-node.json +142 -142
  170. data/generator_files/packer/chef-server.json +137 -137
  171. data/generator_files/packer/compliance.json +133 -133
  172. data/generator_files/packer/infranodes-windows.json +143 -143
  173. data/generator_files/packer/infranodes.json +134 -134
  174. data/generator_files/packer/scripts/PreSysprep.ps1 +9 -0
  175. data/generator_files/packer/workstation.json +160 -142
  176. data/generator_files/templates/arm.md.json.erb +754 -754
  177. data/generator_files/templates/arm.vhd.json.erb +630 -630
  178. data/generator_files/templates/bootstrap-aws.erb +39 -39
  179. data/generator_files/templates/cfn.json.erb +675 -674
  180. data/generator_files/wombat.yml +75 -74
  181. data/lib/wombat/aws.rb +67 -67
  182. data/lib/wombat/build.rb +392 -392
  183. data/lib/wombat/cli.rb +254 -254
  184. data/lib/wombat/common.rb +420 -420
  185. data/lib/wombat/crypto.rb +65 -65
  186. data/lib/wombat/delete.rb +67 -67
  187. data/lib/wombat/deploy.rb +128 -128
  188. data/lib/wombat/init.rb +32 -32
  189. data/lib/wombat/latest.rb +27 -27
  190. data/lib/wombat/output.rb +101 -101
  191. data/lib/wombat/update.rb +20 -20
  192. data/lib/wombat/version.rb +3 -3
  193. data/lib/wombat.rb +8 -8
  194. data/spec/functional/common_spec.rb +26 -26
  195. data/spec/spec_helper.rb +103 -103
  196. data/spec/unit/common_spec.rb +116 -116
  197. data/terraform/README.md +13 -13
  198. data/terraform/templates/terraform.tfvars.erb +12 -12
  199. data/terraform/wombat.tf +328 -328
  200. data/wombat-cli.gemspec +36 -36
  201. metadata +6 -4
@@ -1,755 +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
- }
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
755
  }