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,144 +1,144 @@
1
- {
2
- "variables": {
3
- "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
4
- "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
5
- "aws_region": "{{env `AWS_REGION`}}",
6
- "aws_source_ami": "ami-87c037e7",
7
- "azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
8
- "azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
9
- "azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
10
- "azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
11
- "azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
12
- "azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
13
- "azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
14
- "azure_location": "",
15
- "azure_image_publisher": "MicrosoftWindowsServer",
16
- "azure_image_offer": "WindowsServer",
17
- "azure_image_sku": "2012-R2-Datacenter",
18
- "azure_image_version": "latest",
19
- "gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
20
- "gce_project_id": "{{env `GCE_PROJECT_ID`}}",
21
- "gce_zone": "{{env `GCE_ZONE`}}",
22
- "gce_source_image": "windows-server-2012-r2-dc-v20160809",
23
- "build-nodes": "1",
24
- "chef_channel": "stable",
25
- "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
26
- "chef_ver": "latest",
27
- "domain": "animals.biz",
28
- "domain_prefix": "",
29
- "enterprise": "mammals",
30
- "node-name": "acceptance",
31
- "org": "marsupials",
32
- "ssh_username": "ubuntu",
33
- "winrm_password": "RL9@T40BTmXh",
34
- "winrm_username": "Administrator",
35
- "workstations": "1"
36
- },
37
- "builders": [
38
- {
39
- "type": "amazon-ebs",
40
- "access_key": "{{user `aws_access_key`}}",
41
- "secret_key": "{{user `aws_secret_key`}}",
42
- "region": "{{user `aws_region`}}",
43
- "source_ami": "{{user `aws_source_ami`}}",
44
- "instance_type": "m4.large",
45
- "communicator": "winrm",
46
- "associate_public_ip_address": true,
47
- "winrm_port": 5985,
48
- "winrm_username": "{{user `winrm_username`}}",
49
- "winrm_password": "{{user `winrm_password`}}",
50
- "user_data_file": "{{template_dir}}/scripts/bootstrap-aws.txt",
51
- "ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
52
- },
53
- {
54
- "type": "azure-arm",
55
- "subscription_id": "{{user `azure_subscription_id`}}",
56
- "client_id": "{{user `azure_client_id`}}",
57
- "client_secret": "{{user `azure_client_secret`}}",
58
- "tenant_id": "{{user `azure_tenant_id`}}",
59
- "resource_group_name": "{{user `azure_resource_group`}}",
60
- "storage_account": "{{user `azure_storage_account`}}",
61
- "object_id": "{{user `azure_object_id`}}",
62
- "capture_container_name": "images",
63
- "capture_name_prefix": "automate-infranode-{{user `node-name`}}-{{timestamp}}",
64
- "os_type": "Windows",
65
- "image_publisher": "{{ user `azure_image_publisher` }}",
66
- "image_offer": "{{ user `azure_image_offer` }}",
67
- "image_sku": "{{ user `azure_image_sku` }}",
68
- "image_version": "{{ user `azure_image_version` }}",
69
- "location": "{{user `azure_location`}}",
70
- "vm_size": "Standard_DS3_v2",
71
- "communicator": "winrm",
72
- "winrm_use_ssl": "true",
73
- "winrm_insecure": "true",
74
- "winrm_port": 5986,
75
- "winrm_timeout": "5m"
76
- },
77
- {
78
- "type": "googlecompute",
79
- "account_file": "{{user `gce_account_file`}}",
80
- "project_id": "{{user `gce_project_id`}}",
81
- "source_image": "{{user `gce_source_image`}}",
82
- "zone": "{{user `gce_zone`}}",
83
- "disk_type": "pd-ssd",
84
- "disk_size": "80",
85
- "machine_type": "n1-highcpu-8",
86
- "image_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}",
87
- "communicator": "winrm",
88
- "winrm_port": 5985,
89
- "winrm_username": "{{user `winrm_username`}}",
90
- "winrm_password": "{{user `winrm_password`}}",
91
- "metadata": {
92
- "windows-startup-script-url": "gs://wombat-bootstrap/win-bootstrap.ps1"
93
- }
94
- }
95
- ],
96
- "provisioners": [
97
- {
98
- "type": "file",
99
- "source": "{{pwd}}/keys/",
100
- "destination": "C:\\Windows\\Temp"
101
- },
102
- {
103
- "type": "file",
104
- "source": "{{pwd}}/files/",
105
- "destination": "C:\\Windows\\Temp"
106
- },
107
- {
108
- "type": "chef-solo",
109
- "install_command": "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel {{user `chef_channel`}} -version {{user `chef_ver`}}\"",
110
- "guest_os_type": "windows",
111
- "cookbook_paths": [
112
- "{{pwd}}/vendored-cookbooks/infranodes"
113
- ],
114
- "run_list": [
115
- "infranodes",
116
- "wombat::etc-hosts"
117
- ],
118
- "json": {
119
- "demo": {
120
- "admin-user": "{{user `ssh_username`}}",
121
- "build-nodes": "{{user `build-nodes`}}",
122
- "domain_prefix": "{{user `domain_prefix`}}",
123
- "domain": "{{user `domain`}}",
124
- "enterprise": "{{user `enterprise`}}",
125
- "node-name": "{{user `node-name`}}",
126
- "org": "{{user `org`}}",
127
- "versions": {
128
- "chef": "{{user `chef_channel`}}-{{user `chef_ver`}}"
129
- }
130
- }
131
- }
132
- },
133
- {
134
- "only": [
135
- "azure-arm"
136
- ],
137
- "type": "windows-shell",
138
- "inline": [
139
- "cd C:\\Windows\\System32\\sysprep",
140
- "sysprep.exe /quiet /generalize /oobe /shutdown"
141
- ]
142
- }
143
- ]
1
+ {
2
+ "variables": {
3
+ "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
4
+ "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
5
+ "aws_region": "{{env `AWS_REGION`}}",
6
+ "aws_source_ami": "ami-87c037e7",
7
+ "azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
8
+ "azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
9
+ "azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
10
+ "azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
11
+ "azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
12
+ "azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
13
+ "azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
14
+ "azure_location": "",
15
+ "azure_image_publisher": "MicrosoftWindowsServer",
16
+ "azure_image_offer": "WindowsServer",
17
+ "azure_image_sku": "2012-R2-Datacenter",
18
+ "azure_image_version": "latest",
19
+ "gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
20
+ "gce_project_id": "{{env `GCE_PROJECT_ID`}}",
21
+ "gce_zone": "{{env `GCE_ZONE`}}",
22
+ "gce_source_image": "windows-server-2012-r2-dc-v20160809",
23
+ "build-nodes": "1",
24
+ "chef_channel": "stable",
25
+ "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
26
+ "chef_ver": "latest",
27
+ "domain": "animals.biz",
28
+ "domain_prefix": "",
29
+ "enterprise": "mammals",
30
+ "node-name": "acceptance",
31
+ "org": "marsupials",
32
+ "ssh_username": "ubuntu",
33
+ "winrm_password": "RL9@T40BTmXh",
34
+ "winrm_username": "Administrator",
35
+ "workstations": "1"
36
+ },
37
+ "builders": [
38
+ {
39
+ "type": "amazon-ebs",
40
+ "access_key": "{{user `aws_access_key`}}",
41
+ "secret_key": "{{user `aws_secret_key`}}",
42
+ "region": "{{user `aws_region`}}",
43
+ "source_ami": "{{user `aws_source_ami`}}",
44
+ "instance_type": "m4.large",
45
+ "communicator": "winrm",
46
+ "associate_public_ip_address": true,
47
+ "winrm_port": 5985,
48
+ "winrm_username": "{{user `winrm_username`}}",
49
+ "winrm_password": "{{user `winrm_password`}}",
50
+ "user_data_file": "{{template_dir}}/scripts/bootstrap-aws.txt",
51
+ "ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
52
+ },
53
+ {
54
+ "type": "azure-arm",
55
+ "subscription_id": "{{user `azure_subscription_id`}}",
56
+ "client_id": "{{user `azure_client_id`}}",
57
+ "client_secret": "{{user `azure_client_secret`}}",
58
+ "tenant_id": "{{user `azure_tenant_id`}}",
59
+ "resource_group_name": "{{user `azure_resource_group`}}",
60
+ "storage_account": "{{user `azure_storage_account`}}",
61
+ "object_id": "{{user `azure_object_id`}}",
62
+ "capture_container_name": "images",
63
+ "capture_name_prefix": "automate-infranode-{{user `node-name`}}-{{timestamp}}",
64
+ "os_type": "Windows",
65
+ "image_publisher": "{{ user `azure_image_publisher` }}",
66
+ "image_offer": "{{ user `azure_image_offer` }}",
67
+ "image_sku": "{{ user `azure_image_sku` }}",
68
+ "image_version": "{{ user `azure_image_version` }}",
69
+ "location": "{{user `azure_location`}}",
70
+ "vm_size": "Standard_DS3_v2",
71
+ "communicator": "winrm",
72
+ "winrm_use_ssl": "true",
73
+ "winrm_insecure": "true",
74
+ "winrm_port": 5986,
75
+ "winrm_timeout": "5m"
76
+ },
77
+ {
78
+ "type": "googlecompute",
79
+ "account_file": "{{user `gce_account_file`}}",
80
+ "project_id": "{{user `gce_project_id`}}",
81
+ "source_image": "{{user `gce_source_image`}}",
82
+ "zone": "{{user `gce_zone`}}",
83
+ "disk_type": "pd-ssd",
84
+ "disk_size": "80",
85
+ "machine_type": "n1-highcpu-8",
86
+ "image_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}",
87
+ "communicator": "winrm",
88
+ "winrm_port": 5985,
89
+ "winrm_username": "{{user `winrm_username`}}",
90
+ "winrm_password": "{{user `winrm_password`}}",
91
+ "metadata": {
92
+ "windows-startup-script-url": "gs://wombat-bootstrap/win-bootstrap.ps1"
93
+ }
94
+ }
95
+ ],
96
+ "provisioners": [
97
+ {
98
+ "type": "file",
99
+ "source": "{{pwd}}/keys/",
100
+ "destination": "C:\\Windows\\Temp"
101
+ },
102
+ {
103
+ "type": "file",
104
+ "source": "{{pwd}}/files/",
105
+ "destination": "C:\\Windows\\Temp"
106
+ },
107
+ {
108
+ "type": "chef-solo",
109
+ "install_command": "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel {{user `chef_channel`}} -version {{user `chef_ver`}}\"",
110
+ "guest_os_type": "windows",
111
+ "cookbook_paths": [
112
+ "{{pwd}}/vendored-cookbooks/infranodes"
113
+ ],
114
+ "run_list": [
115
+ "infranodes",
116
+ "wombat::etc-hosts"
117
+ ],
118
+ "json": {
119
+ "demo": {
120
+ "admin-user": "{{user `ssh_username`}}",
121
+ "build-nodes": "{{user `build-nodes`}}",
122
+ "domain_prefix": "{{user `domain_prefix`}}",
123
+ "domain": "{{user `domain`}}",
124
+ "enterprise": "{{user `enterprise`}}",
125
+ "node-name": "{{user `node-name`}}",
126
+ "org": "{{user `org`}}",
127
+ "versions": {
128
+ "chef": "{{user `chef_channel`}}-{{user `chef_ver`}}"
129
+ }
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "only": [
135
+ "azure-arm"
136
+ ],
137
+ "type": "windows-shell",
138
+ "inline": [
139
+ "cd C:\\Windows\\System32\\sysprep",
140
+ "sysprep.exe /quiet /generalize /oobe /shutdown"
141
+ ]
142
+ }
143
+ ]
144
144
  }
@@ -1,135 +1,135 @@
1
- {
2
- "variables": {
3
- "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
4
- "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
5
- "aws_region": "{{env `AWS_REGION`}}",
6
- "aws_source_ami": "ami-8e0b9499",
7
- "azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
8
- "azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
9
- "azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
10
- "azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
11
- "azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
12
- "azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
13
- "azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
14
- "azure_location": "",
15
- "azure_image_publisher": "Canonical",
16
- "azure_image_offer": "UbuntuServer",
17
- "azure_image_sku": "14.04.5-LTS",
18
- "azure_image_version": "latest",
19
- "gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
20
- "gce_project_id": "{{env `GCE_PROJECT_ID`}}",
21
- "gce_zone": "{{env `GCE_ZONE`}}",
22
- "gce_source_image": "ubuntu-1404-trusty-v20160809a",
23
- "build-nodes": "1",
24
- "chef_channel": "stable",
25
- "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
26
- "chef_ver": "latest",
27
- "domain": "animals.biz",
28
- "domain_prefix": "",
29
- "enterprise": "mammals",
30
- "node-name": "acceptance",
31
- "org": "marsupials",
32
- "ssh_username": "{{user `ssh_username`}}",
33
- "workstations": "1"
34
- },
35
- "builders": [
36
- {
37
- "type": "amazon-ebs",
38
- "access_key": "{{user `aws_access_key`}}",
39
- "secret_key": "{{user `aws_secret_key`}}",
40
- "region": "{{user `aws_region`}}",
41
- "source_ami": "{{user `aws_source_ami`}}",
42
- "instance_type": "t2.medium",
43
- "communicator": "ssh",
44
- "associate_public_ip_address": true,
45
- "ssh_username": "{{user `ssh_username`}}",
46
- "ssh_pty": true,
47
- "ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
48
- },
49
- {
50
- "type": "azure-arm",
51
- "subscription_id": "{{user `azure_subscription_id`}}",
52
- "client_id": "{{user `azure_client_id`}}",
53
- "client_secret": "{{user `azure_client_secret`}}",
54
- "tenant_id": "{{user `azure_tenant_id`}}",
55
- "resource_group_name": "{{user `azure_resource_group`}}",
56
- "storage_account": "{{user `azure_storage_account`}}",
57
- "object_id": "{{user `azure_object_id`}}",
58
- "capture_container_name": "images",
59
- "capture_name_prefix": "infranode-{{user `node-name`}}",
60
- "os_type": "Linux",
61
- "image_publisher": "{{ user `azure_image_publisher` }}",
62
- "image_offer": "{{ user `azure_image_offer` }}",
63
- "image_sku": "{{ user `azure_image_sku` }}",
64
- "image_version": "{{ user `azure_image_version` }}",
65
- "location": "{{user `azure_location`}}",
66
- "vm_size": "Standard_DS3_v2",
67
- "ssh_username": "{{user `ssh_username`}}",
68
- "ssh_pty": true
69
- },
70
- {
71
- "type": "googlecompute",
72
- "account_file": "{{user `gce_account_file`}}",
73
- "project_id": "{{user `gce_project_id`}}",
74
- "source_image": "{{user `gce_source_image`}}",
75
- "zone": "{{user `gce_zone`}}",
76
- "disk_type": "pd-ssd",
77
- "disk_size": "80",
78
- "image_name": "chef-{{timestamp}}",
79
- "machine_type": "n1-standard-2",
80
- "ssh_username": "{{user `ssh_username`}}",
81
- "ssh_pty": true
82
- }
83
- ],
84
- "provisioners": [
85
- {
86
- "type": "file",
87
- "source": "{{pwd}}/files/",
88
- "destination": "/tmp"
89
- },
90
- {
91
- "type": "file",
92
- "source": "{{pwd}}/keys/",
93
- "destination": "/tmp"
94
- },
95
- {
96
- "type": "chef-solo",
97
- "install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
98
- "cookbook_paths": [
99
- "{{pwd}}/vendored-cookbooks/infranodes"
100
- ],
101
- "run_list": [
102
- "infranodes",
103
- "wombat::authorized-keys",
104
- "wombat::etc-hosts"
105
- ],
106
- "json": {
107
- "demo": {
108
- "admin-user": "{{user `ssh_username`}}",
109
- "domain_prefix": "{{user `domain_prefix`}}",
110
- "domain": "{{user `domain`}}",
111
- "enterprise": "{{user `enterprise`}}",
112
- "org": "{{user `org`}}",
113
- "build-nodes": "{{user `build-nodes`}}",
114
- "workstations": "{{user `workstations`}}",
115
- "node-name": "{{user `node-name`}}",
116
- "versions": {
117
- "chef": "{{user `chef_channel`}}-{{user `chef_ver`}}"
118
- }
119
- }
120
- }
121
- },
122
- {
123
- "only": [
124
- "azure-arm"
125
- ],
126
- "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
127
- "inline": [
128
- "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
129
- ],
130
- "inline_shebang": "/bin/sh -x",
131
- "type": "shell",
132
- "skip_clean": true
133
- }
134
- ]
1
+ {
2
+ "variables": {
3
+ "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
4
+ "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
5
+ "aws_region": "{{env `AWS_REGION`}}",
6
+ "aws_source_ami": "ami-8e0b9499",
7
+ "azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
8
+ "azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
9
+ "azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
10
+ "azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
11
+ "azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}",
12
+ "azure_resource_group": "{{env `AZURE_RESOURCE_GROUP`}}",
13
+ "azure_object_id": "{{env `AZURE_OBJECT_ID`}}",
14
+ "azure_location": "",
15
+ "azure_image_publisher": "Canonical",
16
+ "azure_image_offer": "UbuntuServer",
17
+ "azure_image_sku": "14.04.5-LTS",
18
+ "azure_image_version": "latest",
19
+ "gce_account_file": "{{env `GCE_ACCOUNT_FILE`}}",
20
+ "gce_project_id": "{{env `GCE_PROJECT_ID`}}",
21
+ "gce_zone": "{{env `GCE_ZONE`}}",
22
+ "gce_source_image": "ubuntu-1404-trusty-v20160809a",
23
+ "build-nodes": "1",
24
+ "chef_channel": "stable",
25
+ "chef_install_url": "curl -L https://omnitruck.chef.io/install.sh",
26
+ "chef_ver": "latest",
27
+ "domain": "animals.biz",
28
+ "domain_prefix": "",
29
+ "enterprise": "mammals",
30
+ "node-name": "acceptance",
31
+ "org": "marsupials",
32
+ "ssh_username": "{{user `ssh_username`}}",
33
+ "workstations": "1"
34
+ },
35
+ "builders": [
36
+ {
37
+ "type": "amazon-ebs",
38
+ "access_key": "{{user `aws_access_key`}}",
39
+ "secret_key": "{{user `aws_secret_key`}}",
40
+ "region": "{{user `aws_region`}}",
41
+ "source_ami": "{{user `aws_source_ami`}}",
42
+ "instance_type": "t2.medium",
43
+ "communicator": "ssh",
44
+ "associate_public_ip_address": true,
45
+ "ssh_username": "{{user `ssh_username`}}",
46
+ "ssh_pty": true,
47
+ "ami_name": "automate-infranode-{{user `node-name`}}-{{timestamp}}"
48
+ },
49
+ {
50
+ "type": "azure-arm",
51
+ "subscription_id": "{{user `azure_subscription_id`}}",
52
+ "client_id": "{{user `azure_client_id`}}",
53
+ "client_secret": "{{user `azure_client_secret`}}",
54
+ "tenant_id": "{{user `azure_tenant_id`}}",
55
+ "resource_group_name": "{{user `azure_resource_group`}}",
56
+ "storage_account": "{{user `azure_storage_account`}}",
57
+ "object_id": "{{user `azure_object_id`}}",
58
+ "capture_container_name": "images",
59
+ "capture_name_prefix": "infranode-{{user `node-name`}}",
60
+ "os_type": "Linux",
61
+ "image_publisher": "{{ user `azure_image_publisher` }}",
62
+ "image_offer": "{{ user `azure_image_offer` }}",
63
+ "image_sku": "{{ user `azure_image_sku` }}",
64
+ "image_version": "{{ user `azure_image_version` }}",
65
+ "location": "{{user `azure_location`}}",
66
+ "vm_size": "Standard_DS3_v2",
67
+ "ssh_username": "{{user `ssh_username`}}",
68
+ "ssh_pty": true
69
+ },
70
+ {
71
+ "type": "googlecompute",
72
+ "account_file": "{{user `gce_account_file`}}",
73
+ "project_id": "{{user `gce_project_id`}}",
74
+ "source_image": "{{user `gce_source_image`}}",
75
+ "zone": "{{user `gce_zone`}}",
76
+ "disk_type": "pd-ssd",
77
+ "disk_size": "80",
78
+ "image_name": "chef-{{timestamp}}",
79
+ "machine_type": "n1-standard-2",
80
+ "ssh_username": "{{user `ssh_username`}}",
81
+ "ssh_pty": true
82
+ }
83
+ ],
84
+ "provisioners": [
85
+ {
86
+ "type": "file",
87
+ "source": "{{pwd}}/files/",
88
+ "destination": "/tmp"
89
+ },
90
+ {
91
+ "type": "file",
92
+ "source": "{{pwd}}/keys/",
93
+ "destination": "/tmp"
94
+ },
95
+ {
96
+ "type": "chef-solo",
97
+ "install_command": "{{user `chef_install_url`}} | sudo bash -s -- -c {{user `chef_channel`}} -v {{user `chef_ver`}}",
98
+ "cookbook_paths": [
99
+ "{{pwd}}/vendored-cookbooks/infranodes"
100
+ ],
101
+ "run_list": [
102
+ "infranodes",
103
+ "wombat::authorized-keys",
104
+ "wombat::etc-hosts"
105
+ ],
106
+ "json": {
107
+ "demo": {
108
+ "admin-user": "{{user `ssh_username`}}",
109
+ "domain_prefix": "{{user `domain_prefix`}}",
110
+ "domain": "{{user `domain`}}",
111
+ "enterprise": "{{user `enterprise`}}",
112
+ "org": "{{user `org`}}",
113
+ "build-nodes": "{{user `build-nodes`}}",
114
+ "workstations": "{{user `workstations`}}",
115
+ "node-name": "{{user `node-name`}}",
116
+ "versions": {
117
+ "chef": "{{user `chef_channel`}}-{{user `chef_ver`}}"
118
+ }
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "only": [
124
+ "azure-arm"
125
+ ],
126
+ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
127
+ "inline": [
128
+ "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
129
+ ],
130
+ "inline_shebang": "/bin/sh -x",
131
+ "type": "shell",
132
+ "skip_clean": true
133
+ }
134
+ ]
135
135
  }
@@ -0,0 +1,9 @@
1
+ $LaunchConfigFile = "C:\ProgramData\Amazon\EC2-Windows\Launch\Config\LaunchConfig.json"
2
+ $UnattendFile = "C:\ProgramData\Amazon\EC2-Windows\Launch\Sysprep\Unattend.xml"
3
+
4
+ # EC2Launch should not set the `Administrator` user password to a random string
5
+ (Get-Content $LaunchConfigFile -Verbose).Replace("Random", "DoNothing") | Set-Content $LaunchConfigFile -Verbose
6
+
7
+ # Do not utilize the CopyProfile feature of the specialize step
8
+ # We do not want the `Administrator` user profile to overwrite the `Default` user profile
9
+ (Get-Content $UnattendFile -Verbose).Replace("<CopyProfile>true</CopyProfile>", "<CopyProfile>false</CopyProfile>") | Set-Content $UnattendFile -Verbose