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,631 +1,631 @@
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
- "network": {
53
- "virtual": {
54
- "name": "ChefAutomate-VNET",
55
- "addressPrefix": "172.31.54.0/24"
56
- },
57
- "subnet": {
58
- "name": "ChefAutomate-Subnet",
59
- "addressPrefix": "172.31.54.0/24"
60
- },
61
- "ipAddresses": {
62
- "chef": {
63
- "internal": {
64
- "address": "172.31.54.10",
65
- "allocationMethod": "static"
66
- }
67
- },
68
- "automate": {
69
- "internal": {
70
- "address": "172.31.54.11",
71
- "allocationMethod": "static"
72
- }
73
- },
74
- "compliance": {
75
- "internal": {
76
- "address": "172.31.54.12",
77
- "allocationMethod": "static"
78
- }
79
- },
80
- "workstation": {
81
- "internal": {
82
- "addressPrefix": "172.31.54.",
83
- "allocationMethod": "static"
84
- },
85
- "external": {
86
- "domainNameLabel": "[concat('ws-', variables('uniqueShort'))]",
87
- "allocationMethod": "dynamic"
88
- }
89
- },
90
- "buildnode": {
91
- "internal": {
92
- "addressPrefix": "172.31.54.",
93
- "allocationMethod": "static"
94
- }
95
- },
96
- "infranode": {
97
- "internal": {
98
- "addressPrefix": "172.31.54.",
99
- "allocationMethod": "static"
100
- }
101
- }
102
- }
103
- },
104
-
105
- "customData": "#cloud-config\nmanage_etc_hosts: false\n\npackage_update: false"
106
- },
107
- "resources": [
108
-
109
- {
110
- "type": "Microsoft.Network/virtualNetworks",
111
- "name": "[variables('network').virtual.name]",
112
- "apiVersion": "2015-06-15",
113
- "location": "[variables('location')]",
114
- "properties": {
115
- "addressSpace": {
116
- "addressPrefixes": [
117
- "[variables('network').virtual.addressPrefix]"
118
- ]
119
- },
120
- "subnets": [
121
- {
122
- "name": "[variables('network').subnet.name]",
123
- "properties": {
124
- "addressPrefix": "[variables('network').subnet.addressPrefix]"
125
- }
126
- }
127
- ]
128
- }
129
- },
130
-
131
-
132
-
133
- <% 1.upto(@workstations) do |i| -%>
134
-
135
- {
136
- "type": "Microsoft.Network/publicIPAddresses",
137
- "name": "Workstation-<%= i.to_s %>-PublicIPAddress",
138
- "apiVersion": "2015-06-15",
139
- "location": "[variables('location')]",
140
- "properties": {
141
- "publicIPAllocationMethod": "[variables('network').ipAddresses.workstation.external.allocationMethod]",
142
- "dnsSettings": {
143
- "domainNameLabel": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]"
144
- }
145
- }
146
- },
147
-
148
- {
149
- "type": "Microsoft.Network/networkInterfaces",
150
- "name": "Workstation-<%= i.to_s %>-NIC",
151
- "apiVersion": "2015-06-15",
152
- "location": "[variables('location')]",
153
- "dependsOn": [
154
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]",
155
- "Microsoft.Network/publicIPAddresses/Workstation-<%= i.to_s %>-PublicIPAddress"
156
- ],
157
- "properties": {
158
- "ipConfigurations": [
159
- {
160
- "name": "ipconfig1",
161
- "properties": {
162
- "privateIPAllocationMethod": "[variables('network').ipAddresses.workstation.internal.allocationMethod]",
163
- "privateIPAddress": "[concat(variables('network').ipAddresses.workstation.internal.addressPrefix, '<%= 200 + i %>')]",
164
- "publicIPAddress": {
165
- "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'Workstation-<%= i.to_s %>-PublicIPAddress')]"
166
- },
167
- "subnet": {
168
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
169
- }
170
- }
171
- }
172
- ]
173
- }
174
- },
175
-
176
- {
177
- "type": "Microsoft.Compute/virtualMachines",
178
- "name": "Workstation-<%= i.to_s %>-VM",
179
- "apiVersion": "2015-06-15",
180
- "location": "[variables('location')]",
181
- "dependsOn": [
182
- "Microsoft.Network/networkInterfaces/Workstation-<%= i.to_s %>-NIC"
183
- ],
184
- "tags": {
185
- "name": "[concat(parameters('demoName'), ' Workstation <%= i.to_s %>')]"
186
- },
187
- "properties": {
188
- "hardwareProfile": {
189
- "vmSize": "Standard_DS2_v2"
190
- },
191
- "osProfile": {
192
- "computerName": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]",
193
- "adminUsername": "chef",
194
- "adminPassword": "[parameters('adminPassword')]"
195
- },
196
- "storageProfile": {
197
- "osDisk": {
198
- "name": "workstation-<%= i.to_s %>-osdisk",
199
- "osType": "windows",
200
- "createOption": "FromImage",
201
- "caching": "ReadWrite",
202
- "image": {
203
- "uri": "<%= @workstation_ami[i] %>"
204
- },
205
- "vhd": {
206
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/workstation-<%= i.to_s %>-osdisk.vhd')]"
207
- }
208
- }
209
- },
210
- "networkProfile": {
211
- "networkInterfaces": [
212
- {
213
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'Workstation-<%= i.to_s %>-NIC')]"
214
- }
215
- ]
216
- }
217
- }
218
- },
219
-
220
- <% end %>
221
-
222
- <% 1.upto(@build_nodes) do |i| -%>
223
-
224
- {
225
- "type": "Microsoft.Network/networkInterfaces",
226
- "name": "BuildNode-<%= i.to_s %>-NIC",
227
- "apiVersion": "2015-06-15",
228
- "location": "[variables('location')]",
229
- "dependsOn": [
230
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
231
- ],
232
- "properties": {
233
- "ipConfigurations": [
234
- {
235
- "name": "ipconfig1",
236
- "properties": {
237
- "privateIPAllocationMethod": "[variables('network').ipAddresses.buildnode.internal.allocationMethod]",
238
- "privateIPAddress": "[concat(variables('network').ipAddresses.buildnode.internal.addressPrefix, '<%= 50 + i %>')]",
239
- "subnet": {
240
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
241
- }
242
- }
243
- }
244
- ]
245
- }
246
- },
247
-
248
- {
249
- "type": "Microsoft.Compute/virtualMachines",
250
- "name": "BuildNode-<%= i.to_s %>-VM",
251
- "apiVersion": "2015-06-15",
252
- "location": "[variables('location')]",
253
- "dependsOn": [
254
- "Microsoft.Network/networkInterfaces/BuildNode-<%= i.to_s %>-NIC"
255
- ],
256
- "tags": {
257
- "name": "[concat(parameters('demoName'), ' Build Node <%= i.to_s %>')]"
258
- },
259
- "properties": {
260
- "hardwareProfile": {
261
- "vmSize": "Standard_DS2_v2"
262
- },
263
- "osProfile": {
264
- "computerName": "build-node-<%= i.to_s %>",
265
- "adminUsername": "ubuntu",
266
- "adminPassword": "[parameters('adminPassword')]",
267
- "linuxConfiguration": {
268
- "disablePasswordAuthentication": "true",
269
- "ssh": {
270
- "publicKeys": [
271
- {
272
- "path": "/home/ubuntu/.ssh/authorized_keys",
273
- "keyData": "<%= @public_key -%>"
274
- }
275
- ]
276
- }
277
- }
278
- },
279
- "storageProfile": {
280
- "osDisk": {
281
- "name": "buildnode-<%= i.to_s %>-osdisk",
282
- "osType": "linux",
283
- "createOption": "FromImage",
284
- "caching": "ReadWrite",
285
- "image": {
286
- "uri": "<%= @build_node_ami[i] %>"
287
- },
288
- "vhd": {
289
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/buildnode-<%= i.to_s %>-osdisk.vhd')]"
290
- }
291
- }
292
- },
293
- "networkProfile": {
294
- "networkInterfaces": [
295
- {
296
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'BuildNode-<%= i.to_s %>-NIC')]"
297
- }
298
- ]
299
- }
300
- }
301
- },
302
-
303
- <% end %>
304
-
305
- <% @infra.sort.each do |name, _uri| -%>
306
-
307
- {
308
- "type": "Microsoft.Network/networkInterfaces",
309
- "name": "InfraNode-<%= name %>-NIC",
310
- "apiVersion": "2015-06-15",
311
- "location": "[variables('location')]",
312
- "dependsOn": [
313
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
314
- ],
315
- "properties": {
316
- "ipConfigurations": [
317
- {
318
- "name": "ipconfig1",
319
- "properties": {
320
- "privateIPAllocationMethod": "[variables('network').ipAddresses.infranode.internal.allocationMethod]",
321
- "privateIPAddress": "[concat(variables('network').ipAddresses.infranode.internal.addressPrefix, '<%= 101 + @infra.keys.find_index(name) %>')]",
322
- "subnet": {
323
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
324
- }
325
- }
326
- }
327
- ]
328
- }
329
- },
330
-
331
- {
332
- "type": "Microsoft.Compute/virtualMachines",
333
- "name": "InfraNode-<%= name %>-VM",
334
- "apiVersion": "2015-06-15",
335
- "location": "[variables('location')]",
336
- "dependsOn": [
337
- "Microsoft.Network/networkInterfaces/InfraNode-<%= name %>-NIC"
338
- ],
339
- "tags": {
340
- "name": "[concat(parameters('demoName'), ' Infra Node - <%= name %>')]"
341
- },
342
- "properties": {
343
- "hardwareProfile": {
344
- "vmSize": "Standard_DS2_v2"
345
- },
346
- "osProfile": {
347
- "computerName": "<%= name %>",
348
- "adminUsername": "ubuntu",
349
- "adminPassword": "[parameters('adminPassword')]",
350
- "linuxConfiguration": {
351
- "disablePasswordAuthentication": "true",
352
- "ssh": {
353
- "publicKeys": [
354
- {
355
- "path": "/home/ubuntu/.ssh/authorized_keys",
356
- "keyData": "<%= @public_key -%>"
357
- }
358
- ]
359
- }
360
- }
361
- },
362
- "storageProfile": {
363
- "osDisk": {
364
- "name": "infranode-<%= name %>-osdisk",
365
- "osType": "linux",
366
- "createOption": "FromImage",
367
- "caching": "ReadWrite",
368
- "image": {
369
- "uri": "<%= _uri %>"
370
- },
371
- "vhd": {
372
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/infranode-<%= name %>-osdisk.vhd')]"
373
- }
374
- }
375
- },
376
- "networkProfile": {
377
- "networkInterfaces": [
378
- {
379
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'InfraNode-<%= name %>-NIC')]"
380
- }
381
- ]
382
- }
383
- }
384
- },
385
-
386
- <% end %>
387
-
388
- {
389
- "type": "Microsoft.Network/networkInterfaces",
390
- "name": "ChefServer-NIC",
391
- "apiVersion": "2015-06-15",
392
- "location": "[variables('location')]",
393
- "dependsOn": [
394
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
395
- ],
396
- "properties": {
397
- "ipConfigurations": [
398
- {
399
- "name": "ipconfig1",
400
- "properties": {
401
- "privateIPAllocationMethod": "[variables('network').ipAddresses.chef.internal.allocationMethod]",
402
- "privateIPAddress": "[variables('network').ipAddresses.chef.internal.address]",
403
- "subnet": {
404
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
405
- }
406
- }
407
- }
408
- ]
409
- }
410
- },
411
-
412
- {
413
- "type": "Microsoft.Compute/virtualMachines",
414
- "name": "ChefServer-VM",
415
- "apiVersion": "2015-06-15",
416
- "location": "[variables('location')]",
417
- "dependsOn": [
418
- "Microsoft.Network/networkInterfaces/ChefServer-NIC"
419
- ],
420
- "tags": {
421
- "name": "[concat(parameters('demoName'), ' Chef Server')]"
422
- },
423
- "properties": {
424
- "hardwareProfile": {
425
- "vmSize": "Standard_F4s"
426
- },
427
- "osProfile": {
428
- "computerName": "[concat('chef-', variables('uniqueShort'))]",
429
- "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname chef\n - chef-server-ctl reconfigure'))]",
430
- "adminUsername": "ubuntu",
431
- "adminPassword": "[parameters('adminPassword')]",
432
- "linuxConfiguration": {
433
- "disablePasswordAuthentication": "true",
434
- "ssh": {
435
- "publicKeys": [
436
- {
437
- "path": "/home/ubuntu/.ssh/authorized_keys",
438
- "keyData": "<%= @public_key -%>"
439
- }
440
- ]
441
- }
442
- }
443
- },
444
- "storageProfile": {
445
- "osDisk": {
446
- "name": "chefserver-osdisk",
447
- "osType": "linux",
448
- "createOption": "FromImage",
449
- "caching": "ReadWrite",
450
- "image": {
451
- "uri": "<%= @chef_server_uri %>"
452
- },
453
- "vhd": {
454
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/chefserver-osdisk.vhd')]"
455
- }
456
- }
457
- },
458
- "networkProfile": {
459
- "networkInterfaces": [
460
- {
461
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ChefServer-NIC')]"
462
- }
463
- ]
464
- }
465
- }
466
- },
467
-
468
- {
469
- "type": "Microsoft.Network/networkInterfaces",
470
- "name": "AutomateServer-NIC",
471
- "apiVersion": "2015-06-15",
472
- "location": "[variables('location')]",
473
- "dependsOn": [
474
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
475
- ],
476
- "properties": {
477
- "ipConfigurations": [
478
- {
479
- "name": "ipconfig1",
480
- "properties": {
481
- "privateIPAllocationMethod": "[variables('network').ipAddresses.automate.internal.allocationMethod]",
482
- "privateIPAddress": "[variables('network').ipAddresses.automate.internal.address]",
483
- "subnet": {
484
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
485
- }
486
- }
487
- }
488
- ]
489
- }
490
- },
491
-
492
- {
493
- "type": "Microsoft.Compute/virtualMachines",
494
- "name": "AutomateServer-VM",
495
- "apiVersion": "2015-06-15",
496
- "location": "[variables('location')]",
497
- "dependsOn": [
498
- "Microsoft.Network/networkInterfaces/AutomateServer-NIC"
499
- ],
500
- "tags": {
501
- "name": "[concat(parameters('demoName'), ' Automate Server')]"
502
- },
503
- "properties": {
504
- "hardwareProfile": {
505
- "vmSize": "Standard_F4s"
506
- },
507
- "osProfile": {
508
- "computerName": "[concat('chef-', variables('uniqueShort'))]",
509
- "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname automate\n - chef-server-ctl reconfigure'))]",
510
- "adminUsername": "ubuntu",
511
- "adminPassword": "[parameters('adminPassword')]",
512
- "linuxConfiguration": {
513
- "disablePasswordAuthentication": "true",
514
- "ssh": {
515
- "publicKeys": [
516
- {
517
- "path": "/home/ubuntu/.ssh/authorized_keys",
518
- "keyData": "<%= @public_key -%>"
519
- }
520
- ]
521
- }
522
- }
523
- },
524
- "storageProfile": {
525
- "osDisk": {
526
- "name": "automateserver-osdisk",
527
- "osType": "linux",
528
- "createOption": "FromImage",
529
- "caching": "ReadWrite",
530
- "image": {
531
- "uri": "<%= @automate_uri %>"
532
- },
533
- "vhd": {
534
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/automate-osdisk.vhd')]"
535
- }
536
- }
537
- },
538
- "networkProfile": {
539
- "networkInterfaces": [
540
- {
541
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'AutomateServer-NIC')]"
542
- }
543
- ]
544
- }
545
- }
546
- },
547
-
548
- {
549
- "type": "Microsoft.Network/networkInterfaces",
550
- "name": "ComplianceServer-NIC",
551
- "apiVersion": "2015-06-15",
552
- "location": "[variables('location')]",
553
- "dependsOn": [
554
- "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
555
- ],
556
- "properties": {
557
- "ipConfigurations": [
558
- {
559
- "name": "ipconfig1",
560
- "properties": {
561
- "privateIPAllocationMethod": "[variables('network').ipAddresses.compliance.internal.allocationMethod]",
562
- "privateIPAddress": "[variables('network').ipAddresses.compliance.internal.address]",
563
- "subnet": {
564
- "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
565
- }
566
- }
567
- }
568
- ]
569
- }
570
- },
571
-
572
- {
573
- "type": "Microsoft.Compute/virtualMachines",
574
- "name": "ComplianceServer-VM",
575
- "apiVersion": "2015-06-15",
576
- "location": "[variables('location')]",
577
- "dependsOn": [
578
- "Microsoft.Network/networkInterfaces/ComplianceServer-NIC"
579
- ],
580
- "tags": {
581
- "name": "[concat(parameters('demoName'), ' Compliance Server')]"
582
- },
583
- "properties": {
584
- "hardwareProfile": {
585
- "vmSize": "Standard_F4s"
586
- },
587
- "osProfile": {
588
- "computerName": "[concat('chef-', variables('uniqueShort'))]",
589
- "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname compliance\n - compliance-ctl reconfigure'))]",
590
- "adminUsername": "ubuntu",
591
- "adminPassword": "[parameters('adminPassword')]",
592
- "linuxConfiguration": {
593
- "disablePasswordAuthentication": "true",
594
- "ssh": {
595
- "publicKeys": [
596
- {
597
- "path": "/home/ubuntu/.ssh/authorized_keys",
598
- "keyData": "<%= @public_key -%>"
599
- }
600
- ]
601
- }
602
- }
603
- },
604
- "storageProfile": {
605
- "osDisk": {
606
- "name": "complianceserver-osdisk",
607
- "osType": "linux",
608
- "createOption": "FromImage",
609
- "caching": "ReadWrite",
610
- "image": {
611
- "uri": "<%= @compliance_uri %>"
612
- },
613
- "vhd": {
614
- "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/compliance-osdisk.vhd')]"
615
- }
616
- }
617
- },
618
- "networkProfile": {
619
- "networkInterfaces": [
620
- {
621
- "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ComplianceServer-NIC')]"
622
- }
623
- ]
624
- }
625
- }
626
- }
627
- ],
628
- "outputs": {
629
-
630
- }
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
+ "network": {
53
+ "virtual": {
54
+ "name": "ChefAutomate-VNET",
55
+ "addressPrefix": "172.31.54.0/24"
56
+ },
57
+ "subnet": {
58
+ "name": "ChefAutomate-Subnet",
59
+ "addressPrefix": "172.31.54.0/24"
60
+ },
61
+ "ipAddresses": {
62
+ "chef": {
63
+ "internal": {
64
+ "address": "172.31.54.10",
65
+ "allocationMethod": "static"
66
+ }
67
+ },
68
+ "automate": {
69
+ "internal": {
70
+ "address": "172.31.54.11",
71
+ "allocationMethod": "static"
72
+ }
73
+ },
74
+ "compliance": {
75
+ "internal": {
76
+ "address": "172.31.54.12",
77
+ "allocationMethod": "static"
78
+ }
79
+ },
80
+ "workstation": {
81
+ "internal": {
82
+ "addressPrefix": "172.31.54.",
83
+ "allocationMethod": "static"
84
+ },
85
+ "external": {
86
+ "domainNameLabel": "[concat('ws-', variables('uniqueShort'))]",
87
+ "allocationMethod": "dynamic"
88
+ }
89
+ },
90
+ "buildnode": {
91
+ "internal": {
92
+ "addressPrefix": "172.31.54.",
93
+ "allocationMethod": "static"
94
+ }
95
+ },
96
+ "infranode": {
97
+ "internal": {
98
+ "addressPrefix": "172.31.54.",
99
+ "allocationMethod": "static"
100
+ }
101
+ }
102
+ }
103
+ },
104
+
105
+ "customData": "#cloud-config\nmanage_etc_hosts: false\n\npackage_update: false"
106
+ },
107
+ "resources": [
108
+
109
+ {
110
+ "type": "Microsoft.Network/virtualNetworks",
111
+ "name": "[variables('network').virtual.name]",
112
+ "apiVersion": "2015-06-15",
113
+ "location": "[variables('location')]",
114
+ "properties": {
115
+ "addressSpace": {
116
+ "addressPrefixes": [
117
+ "[variables('network').virtual.addressPrefix]"
118
+ ]
119
+ },
120
+ "subnets": [
121
+ {
122
+ "name": "[variables('network').subnet.name]",
123
+ "properties": {
124
+ "addressPrefix": "[variables('network').subnet.addressPrefix]"
125
+ }
126
+ }
127
+ ]
128
+ }
129
+ },
130
+
131
+
132
+
133
+ <% 1.upto(@workstations) do |i| -%>
134
+
135
+ {
136
+ "type": "Microsoft.Network/publicIPAddresses",
137
+ "name": "Workstation-<%= i.to_s %>-PublicIPAddress",
138
+ "apiVersion": "2015-06-15",
139
+ "location": "[variables('location')]",
140
+ "properties": {
141
+ "publicIPAllocationMethod": "[variables('network').ipAddresses.workstation.external.allocationMethod]",
142
+ "dnsSettings": {
143
+ "domainNameLabel": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]"
144
+ }
145
+ }
146
+ },
147
+
148
+ {
149
+ "type": "Microsoft.Network/networkInterfaces",
150
+ "name": "Workstation-<%= i.to_s %>-NIC",
151
+ "apiVersion": "2015-06-15",
152
+ "location": "[variables('location')]",
153
+ "dependsOn": [
154
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]",
155
+ "Microsoft.Network/publicIPAddresses/Workstation-<%= i.to_s %>-PublicIPAddress"
156
+ ],
157
+ "properties": {
158
+ "ipConfigurations": [
159
+ {
160
+ "name": "ipconfig1",
161
+ "properties": {
162
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.workstation.internal.allocationMethod]",
163
+ "privateIPAddress": "[concat(variables('network').ipAddresses.workstation.internal.addressPrefix, '<%= 200 + i %>')]",
164
+ "publicIPAddress": {
165
+ "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'Workstation-<%= i.to_s %>-PublicIPAddress')]"
166
+ },
167
+ "subnet": {
168
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
169
+ }
170
+ }
171
+ }
172
+ ]
173
+ }
174
+ },
175
+
176
+ {
177
+ "type": "Microsoft.Compute/virtualMachines",
178
+ "name": "Workstation-<%= i.to_s %>-VM",
179
+ "apiVersion": "2015-06-15",
180
+ "location": "[variables('location')]",
181
+ "dependsOn": [
182
+ "Microsoft.Network/networkInterfaces/Workstation-<%= i.to_s %>-NIC"
183
+ ],
184
+ "tags": {
185
+ "name": "[concat(parameters('demoName'), ' Workstation <%= i.to_s %>')]"
186
+ },
187
+ "properties": {
188
+ "hardwareProfile": {
189
+ "vmSize": "Standard_DS2_v2"
190
+ },
191
+ "osProfile": {
192
+ "computerName": "[concat(variables('network').ipAddresses.workstation.external.domainNameLabel, '-', '<%= i.to_s %>')]",
193
+ "adminUsername": "chef",
194
+ "adminPassword": "[parameters('adminPassword')]"
195
+ },
196
+ "storageProfile": {
197
+ "osDisk": {
198
+ "name": "workstation-<%= i.to_s %>-osdisk",
199
+ "osType": "windows",
200
+ "createOption": "FromImage",
201
+ "caching": "ReadWrite",
202
+ "image": {
203
+ "uri": "<%= @workstation_ami[i] %>"
204
+ },
205
+ "vhd": {
206
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/workstation-<%= i.to_s %>-osdisk.vhd')]"
207
+ }
208
+ }
209
+ },
210
+ "networkProfile": {
211
+ "networkInterfaces": [
212
+ {
213
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'Workstation-<%= i.to_s %>-NIC')]"
214
+ }
215
+ ]
216
+ }
217
+ }
218
+ },
219
+
220
+ <% end %>
221
+
222
+ <% 1.upto(@build_nodes) do |i| -%>
223
+
224
+ {
225
+ "type": "Microsoft.Network/networkInterfaces",
226
+ "name": "BuildNode-<%= i.to_s %>-NIC",
227
+ "apiVersion": "2015-06-15",
228
+ "location": "[variables('location')]",
229
+ "dependsOn": [
230
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
231
+ ],
232
+ "properties": {
233
+ "ipConfigurations": [
234
+ {
235
+ "name": "ipconfig1",
236
+ "properties": {
237
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.buildnode.internal.allocationMethod]",
238
+ "privateIPAddress": "[concat(variables('network').ipAddresses.buildnode.internal.addressPrefix, '<%= 50 + i %>')]",
239
+ "subnet": {
240
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
241
+ }
242
+ }
243
+ }
244
+ ]
245
+ }
246
+ },
247
+
248
+ {
249
+ "type": "Microsoft.Compute/virtualMachines",
250
+ "name": "BuildNode-<%= i.to_s %>-VM",
251
+ "apiVersion": "2015-06-15",
252
+ "location": "[variables('location')]",
253
+ "dependsOn": [
254
+ "Microsoft.Network/networkInterfaces/BuildNode-<%= i.to_s %>-NIC"
255
+ ],
256
+ "tags": {
257
+ "name": "[concat(parameters('demoName'), ' Build Node <%= i.to_s %>')]"
258
+ },
259
+ "properties": {
260
+ "hardwareProfile": {
261
+ "vmSize": "Standard_DS2_v2"
262
+ },
263
+ "osProfile": {
264
+ "computerName": "build-node-<%= i.to_s %>",
265
+ "adminUsername": "ubuntu",
266
+ "adminPassword": "[parameters('adminPassword')]",
267
+ "linuxConfiguration": {
268
+ "disablePasswordAuthentication": "true",
269
+ "ssh": {
270
+ "publicKeys": [
271
+ {
272
+ "path": "/home/ubuntu/.ssh/authorized_keys",
273
+ "keyData": "<%= @public_key -%>"
274
+ }
275
+ ]
276
+ }
277
+ }
278
+ },
279
+ "storageProfile": {
280
+ "osDisk": {
281
+ "name": "buildnode-<%= i.to_s %>-osdisk",
282
+ "osType": "linux",
283
+ "createOption": "FromImage",
284
+ "caching": "ReadWrite",
285
+ "image": {
286
+ "uri": "<%= @build_node_ami[i] %>"
287
+ },
288
+ "vhd": {
289
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/buildnode-<%= i.to_s %>-osdisk.vhd')]"
290
+ }
291
+ }
292
+ },
293
+ "networkProfile": {
294
+ "networkInterfaces": [
295
+ {
296
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'BuildNode-<%= i.to_s %>-NIC')]"
297
+ }
298
+ ]
299
+ }
300
+ }
301
+ },
302
+
303
+ <% end %>
304
+
305
+ <% @infra.sort.each do |name, _uri| -%>
306
+
307
+ {
308
+ "type": "Microsoft.Network/networkInterfaces",
309
+ "name": "InfraNode-<%= name %>-NIC",
310
+ "apiVersion": "2015-06-15",
311
+ "location": "[variables('location')]",
312
+ "dependsOn": [
313
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
314
+ ],
315
+ "properties": {
316
+ "ipConfigurations": [
317
+ {
318
+ "name": "ipconfig1",
319
+ "properties": {
320
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.infranode.internal.allocationMethod]",
321
+ "privateIPAddress": "[concat(variables('network').ipAddresses.infranode.internal.addressPrefix, '<%= 101 + @infra.keys.find_index(name) %>')]",
322
+ "subnet": {
323
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
324
+ }
325
+ }
326
+ }
327
+ ]
328
+ }
329
+ },
330
+
331
+ {
332
+ "type": "Microsoft.Compute/virtualMachines",
333
+ "name": "InfraNode-<%= name %>-VM",
334
+ "apiVersion": "2015-06-15",
335
+ "location": "[variables('location')]",
336
+ "dependsOn": [
337
+ "Microsoft.Network/networkInterfaces/InfraNode-<%= name %>-NIC"
338
+ ],
339
+ "tags": {
340
+ "name": "[concat(parameters('demoName'), ' Infra Node - <%= name %>')]"
341
+ },
342
+ "properties": {
343
+ "hardwareProfile": {
344
+ "vmSize": "Standard_DS2_v2"
345
+ },
346
+ "osProfile": {
347
+ "computerName": "<%= name %>",
348
+ "adminUsername": "ubuntu",
349
+ "adminPassword": "[parameters('adminPassword')]",
350
+ "linuxConfiguration": {
351
+ "disablePasswordAuthentication": "true",
352
+ "ssh": {
353
+ "publicKeys": [
354
+ {
355
+ "path": "/home/ubuntu/.ssh/authorized_keys",
356
+ "keyData": "<%= @public_key -%>"
357
+ }
358
+ ]
359
+ }
360
+ }
361
+ },
362
+ "storageProfile": {
363
+ "osDisk": {
364
+ "name": "infranode-<%= name %>-osdisk",
365
+ "osType": "linux",
366
+ "createOption": "FromImage",
367
+ "caching": "ReadWrite",
368
+ "image": {
369
+ "uri": "<%= _uri %>"
370
+ },
371
+ "vhd": {
372
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/infranode-<%= name %>-osdisk.vhd')]"
373
+ }
374
+ }
375
+ },
376
+ "networkProfile": {
377
+ "networkInterfaces": [
378
+ {
379
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'InfraNode-<%= name %>-NIC')]"
380
+ }
381
+ ]
382
+ }
383
+ }
384
+ },
385
+
386
+ <% end %>
387
+
388
+ {
389
+ "type": "Microsoft.Network/networkInterfaces",
390
+ "name": "ChefServer-NIC",
391
+ "apiVersion": "2015-06-15",
392
+ "location": "[variables('location')]",
393
+ "dependsOn": [
394
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
395
+ ],
396
+ "properties": {
397
+ "ipConfigurations": [
398
+ {
399
+ "name": "ipconfig1",
400
+ "properties": {
401
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.chef.internal.allocationMethod]",
402
+ "privateIPAddress": "[variables('network').ipAddresses.chef.internal.address]",
403
+ "subnet": {
404
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
405
+ }
406
+ }
407
+ }
408
+ ]
409
+ }
410
+ },
411
+
412
+ {
413
+ "type": "Microsoft.Compute/virtualMachines",
414
+ "name": "ChefServer-VM",
415
+ "apiVersion": "2015-06-15",
416
+ "location": "[variables('location')]",
417
+ "dependsOn": [
418
+ "Microsoft.Network/networkInterfaces/ChefServer-NIC"
419
+ ],
420
+ "tags": {
421
+ "name": "[concat(parameters('demoName'), ' Chef Server')]"
422
+ },
423
+ "properties": {
424
+ "hardwareProfile": {
425
+ "vmSize": "Standard_F4s"
426
+ },
427
+ "osProfile": {
428
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
429
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname chef\n - chef-server-ctl reconfigure'))]",
430
+ "adminUsername": "ubuntu",
431
+ "adminPassword": "[parameters('adminPassword')]",
432
+ "linuxConfiguration": {
433
+ "disablePasswordAuthentication": "true",
434
+ "ssh": {
435
+ "publicKeys": [
436
+ {
437
+ "path": "/home/ubuntu/.ssh/authorized_keys",
438
+ "keyData": "<%= @public_key -%>"
439
+ }
440
+ ]
441
+ }
442
+ }
443
+ },
444
+ "storageProfile": {
445
+ "osDisk": {
446
+ "name": "chefserver-osdisk",
447
+ "osType": "linux",
448
+ "createOption": "FromImage",
449
+ "caching": "ReadWrite",
450
+ "image": {
451
+ "uri": "<%= @chef_server_uri %>"
452
+ },
453
+ "vhd": {
454
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/chefserver-osdisk.vhd')]"
455
+ }
456
+ }
457
+ },
458
+ "networkProfile": {
459
+ "networkInterfaces": [
460
+ {
461
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ChefServer-NIC')]"
462
+ }
463
+ ]
464
+ }
465
+ }
466
+ },
467
+
468
+ {
469
+ "type": "Microsoft.Network/networkInterfaces",
470
+ "name": "AutomateServer-NIC",
471
+ "apiVersion": "2015-06-15",
472
+ "location": "[variables('location')]",
473
+ "dependsOn": [
474
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
475
+ ],
476
+ "properties": {
477
+ "ipConfigurations": [
478
+ {
479
+ "name": "ipconfig1",
480
+ "properties": {
481
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.automate.internal.allocationMethod]",
482
+ "privateIPAddress": "[variables('network').ipAddresses.automate.internal.address]",
483
+ "subnet": {
484
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
485
+ }
486
+ }
487
+ }
488
+ ]
489
+ }
490
+ },
491
+
492
+ {
493
+ "type": "Microsoft.Compute/virtualMachines",
494
+ "name": "AutomateServer-VM",
495
+ "apiVersion": "2015-06-15",
496
+ "location": "[variables('location')]",
497
+ "dependsOn": [
498
+ "Microsoft.Network/networkInterfaces/AutomateServer-NIC"
499
+ ],
500
+ "tags": {
501
+ "name": "[concat(parameters('demoName'), ' Automate Server')]"
502
+ },
503
+ "properties": {
504
+ "hardwareProfile": {
505
+ "vmSize": "Standard_F4s"
506
+ },
507
+ "osProfile": {
508
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
509
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname automate\n - chef-server-ctl reconfigure'))]",
510
+ "adminUsername": "ubuntu",
511
+ "adminPassword": "[parameters('adminPassword')]",
512
+ "linuxConfiguration": {
513
+ "disablePasswordAuthentication": "true",
514
+ "ssh": {
515
+ "publicKeys": [
516
+ {
517
+ "path": "/home/ubuntu/.ssh/authorized_keys",
518
+ "keyData": "<%= @public_key -%>"
519
+ }
520
+ ]
521
+ }
522
+ }
523
+ },
524
+ "storageProfile": {
525
+ "osDisk": {
526
+ "name": "automateserver-osdisk",
527
+ "osType": "linux",
528
+ "createOption": "FromImage",
529
+ "caching": "ReadWrite",
530
+ "image": {
531
+ "uri": "<%= @automate_uri %>"
532
+ },
533
+ "vhd": {
534
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/automate-osdisk.vhd')]"
535
+ }
536
+ }
537
+ },
538
+ "networkProfile": {
539
+ "networkInterfaces": [
540
+ {
541
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'AutomateServer-NIC')]"
542
+ }
543
+ ]
544
+ }
545
+ }
546
+ },
547
+
548
+ {
549
+ "type": "Microsoft.Network/networkInterfaces",
550
+ "name": "ComplianceServer-NIC",
551
+ "apiVersion": "2015-06-15",
552
+ "location": "[variables('location')]",
553
+ "dependsOn": [
554
+ "[concat('Microsoft.Network/virtualNetworks/', variables('network').virtual.name)]"
555
+ ],
556
+ "properties": {
557
+ "ipConfigurations": [
558
+ {
559
+ "name": "ipconfig1",
560
+ "properties": {
561
+ "privateIPAllocationMethod": "[variables('network').ipAddresses.compliance.internal.allocationMethod]",
562
+ "privateIPAddress": "[variables('network').ipAddresses.compliance.internal.address]",
563
+ "subnet": {
564
+ "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('network').virtual.name), '/subnets/', variables('network').subnet.name)]"
565
+ }
566
+ }
567
+ }
568
+ ]
569
+ }
570
+ },
571
+
572
+ {
573
+ "type": "Microsoft.Compute/virtualMachines",
574
+ "name": "ComplianceServer-VM",
575
+ "apiVersion": "2015-06-15",
576
+ "location": "[variables('location')]",
577
+ "dependsOn": [
578
+ "Microsoft.Network/networkInterfaces/ComplianceServer-NIC"
579
+ ],
580
+ "tags": {
581
+ "name": "[concat(parameters('demoName'), ' Compliance Server')]"
582
+ },
583
+ "properties": {
584
+ "hardwareProfile": {
585
+ "vmSize": "Standard_F4s"
586
+ },
587
+ "osProfile": {
588
+ "computerName": "[concat('chef-', variables('uniqueShort'))]",
589
+ "customData": "[base64(concat(variables('customData'), '\n\nruncmd:\n - hostnamectl set-hostname compliance\n - compliance-ctl reconfigure'))]",
590
+ "adminUsername": "ubuntu",
591
+ "adminPassword": "[parameters('adminPassword')]",
592
+ "linuxConfiguration": {
593
+ "disablePasswordAuthentication": "true",
594
+ "ssh": {
595
+ "publicKeys": [
596
+ {
597
+ "path": "/home/ubuntu/.ssh/authorized_keys",
598
+ "keyData": "<%= @public_key -%>"
599
+ }
600
+ ]
601
+ }
602
+ }
603
+ },
604
+ "storageProfile": {
605
+ "osDisk": {
606
+ "name": "complianceserver-osdisk",
607
+ "osType": "linux",
608
+ "createOption": "FromImage",
609
+ "caching": "ReadWrite",
610
+ "image": {
611
+ "uri": "<%= @compliance_uri %>"
612
+ },
613
+ "vhd": {
614
+ "uri": "[concat('https://', variables('sa').name, '.blob.core.windows.net/', variables('sa').container, '/compliance-osdisk.vhd')]"
615
+ }
616
+ }
617
+ },
618
+ "networkProfile": {
619
+ "networkInterfaces": [
620
+ {
621
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'ComplianceServer-NIC')]"
622
+ }
623
+ ]
624
+ }
625
+ }
626
+ }
627
+ ],
628
+ "outputs": {
629
+
630
+ }
631
631
  }