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
data/terraform/wombat.tf CHANGED
@@ -1,328 +1,328 @@
1
- variable "access_key" {}
2
- variable "secret_key" {}
3
- variable "region" {
4
- default = "us-west-2"
5
- }
6
- variable "az" {
7
- default = "us-west-2c"
8
- }
9
- variable "customer" {
10
- default = "venture-industries"
11
- }
12
- variable "key_file" {
13
- default = "../packer/keys/private.pem"
14
- }
15
- variable "key_name" {
16
- default = "USER_REGION"
17
- }
18
- variable "ttl" {
19
- default = 8
20
- }
21
- variable "num_builders" {
22
- default = 0
23
- }
24
- variable "ami-chef-server" {
25
- default = "ami-f3f10893"
26
- }
27
- variable "ami-automate" {
28
- default = "ami-6abf460a"
29
- }
30
- variable "ami-build-node" {
31
- default = "ami-8c4cb0ec"
32
- }
33
- variable "ami-workstation" {
34
- default = "ami-e8f90088"
35
- }
36
-
37
- provider "aws" {
38
- access_key = "${var.access_key}"
39
- secret_key = "${var.secret_key}"
40
- region = "${var.region}"
41
- }
42
-
43
- resource "aws_vpc" "wombat" {
44
- cidr_block = "172.31.0.0/16"
45
- enable_dns_hostnames = true
46
- enable_dns_support = true
47
- instance_tenancy = "default"
48
-
49
- tags {
50
- "Customer" = "${var.customer}"
51
- "TTL" = "${var.ttl}"
52
- "Name" = "wombat VPC"
53
- }
54
- }
55
-
56
- resource "aws_subnet" "automate" {
57
- vpc_id = "${aws_vpc.wombat.id}"
58
- cidr_block = "172.31.54.0/24"
59
- availability_zone = "${var.az}"
60
- map_public_ip_on_launch = false
61
-
62
- tags {
63
- "Customer" = "${var.customer}"
64
- "TTL" = "${var.ttl}"
65
- "Name" = "${var.customer} wombat automate Subnet"
66
- }
67
- }
68
-
69
- resource "aws_subnet" "prod" {
70
- vpc_id = "${aws_vpc.wombat.id}"
71
- cidr_block = "172.31.62.0/24"
72
- availability_zone = "${var.az}"
73
- map_public_ip_on_launch = false
74
-
75
- tags {
76
- "Customer" = "${var.customer}"
77
- "TTL" = "${var.ttl}"
78
- "Name" = "wombat prod subnet"
79
- }
80
- }
81
-
82
- resource "aws_subnet" "workstations" {
83
- vpc_id = "${aws_vpc.wombat.id}"
84
- cidr_block = "172.31.10.0/24"
85
- availability_zone = "${var.az}"
86
- map_public_ip_on_launch = false
87
-
88
- tags {
89
- "Customer" = "${var.customer}"
90
- "TTL" = "${var.ttl}"
91
- "Name" = "wombat workstations subnet"
92
- }
93
- }
94
-
95
- resource "aws_internet_gateway" "inet-gw" {
96
- vpc_id = "${aws_vpc.wombat.id}"
97
-
98
- tags {
99
- "Customer" = "${var.customer}"
100
- "Name" = "wombat IG"
101
- "TTL" = "${var.ttl}"
102
- }
103
- }
104
-
105
- resource "aws_route_table" "route-table" {
106
- vpc_id = "${aws_vpc.wombat.id}"
107
-
108
- route {
109
- cidr_block = "0.0.0.0/0"
110
- gateway_id = "${aws_internet_gateway.inet-gw.id}"
111
- }
112
-
113
- tags {
114
- "Customer" = "${var.customer}"
115
- "Name" = "wombat RouteTable"
116
- "TTL" = "${var.ttl}"
117
- }
118
- }
119
-
120
- resource "aws_route_table_association" "automate-rta" {
121
- route_table_id = "${aws_route_table.route-table.id}"
122
- subnet_id = "${aws_subnet.automate.id}"
123
- }
124
-
125
- resource "aws_route_table_association" "prod-rta" {
126
- route_table_id = "${aws_route_table.route-table.id}"
127
- subnet_id = "${aws_subnet.prod.id}"
128
- }
129
-
130
- resource "aws_route_table_association" "workstations-rta" {
131
- route_table_id = "${aws_route_table.route-table.id}"
132
- subnet_id = "${aws_subnet.workstations.id}"
133
- }
134
-
135
- resource "aws_network_acl" "wombat-network-acl" {
136
- vpc_id = "${aws_vpc.wombat.id}"
137
- subnet_ids = ["${aws_subnet.automate.id}", "${aws_subnet.prod.id}", "${aws_subnet.workstations.id}"]
138
-
139
- ingress {
140
- from_port = 0
141
- to_port = 0
142
- rule_no = 100
143
- action = "allow"
144
- protocol = "-1"
145
- cidr_block = "0.0.0.0/0"
146
- }
147
-
148
- egress {
149
- from_port = 0
150
- to_port = 0
151
- rule_no = 100
152
- action = "allow"
153
- protocol = "-1"
154
- cidr_block = "0.0.0.0/0"
155
- }
156
-
157
- tags {
158
- "Customer" = "${var.customer}"
159
- "TTL" = "${var.ttl}"
160
- "Name" = "wombat NetworkAcl"
161
- }
162
- }
163
-
164
- resource "aws_instance" "chef-server" {
165
- ami = "${var.ami-chef-server}"
166
- availability_zone = "${var.az}"
167
- instance_type = "c3.xlarge"
168
- key_name = "${var.key_name}"
169
- subnet_id = "${aws_subnet.automate.id}"
170
- vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
171
- associate_public_ip_address = false
172
- private_ip = "172.31.54.10"
173
-
174
- tags {
175
- "Customer" = "${var.customer}"
176
- "Name" = "wombat chef server"
177
- "TTL" = "${var.ttl}"
178
- }
179
-
180
- provisioner "remote-exec" {
181
- connection {
182
- user = "ubuntu"
183
- host = "${aws_instance.chef-server.public_ip}"
184
- timeout = "1m"
185
- key_file = "${var.key_file}"
186
- }
187
- inline = [
188
- "sudo hostnamectl set-hostname chef-server",
189
- "sudo chef-server-ctl reconfigure",
190
- "sudo chef-manage-ctl reconfigure",
191
- "sudo opscode-push-jobs-server-ctl reconfigure"
192
- ]
193
- }
194
- }
195
-
196
- resource "aws_instance" "automate" {
197
- ami = "${var.ami-automate}"
198
- availability_zone = "${var.az}"
199
- instance_type = "c3.xlarge"
200
- key_name = "${var.key_name}"
201
- subnet_id = "${aws_subnet.automate.id}"
202
- vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
203
- associate_public_ip_address = false
204
- private_ip = "172.31.54.11"
205
-
206
- tags {
207
- "Customer" = "${var.customer}"
208
- "Name" = "wombat automate server"
209
- "TTL" = "${var.ttl}"
210
- }
211
-
212
- provisioner "remote-exec" {
213
- connection {
214
- user = "ubuntu"
215
- host = "${aws_instance.automate.public_ip}"
216
- timeout = "1m"
217
- key_file = "${var.key_file}"
218
- }
219
- inline = [
220
- "sudo hostnamectl set-hostname automate",
221
- "sudo automate-ctl reconfigure"
222
- ]
223
- }
224
- }
225
-
226
- resource "aws_instance" "build-node-1" {
227
- ami = "${var.ami-build-node}"
228
- availability_zone = "${var.az}"
229
- instance_type = "c3.large"
230
- key_name = "${var.key_name}"
231
- subnet_id = "${aws_subnet.automate.id}"
232
- vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
233
- associate_public_ip_address = false
234
- private_ip = "172.31.54.12"
235
-
236
- tags {
237
- "Customer" = "${var.customer}"
238
- "Name" = "wombat automate build node 1"
239
- "TTL" = "${var.ttl}"
240
- }
241
-
242
- provisioner "remote-exec" {
243
- connection {
244
- user = "ubuntu"
245
- host = "${aws_instance.automate.public_ip}"
246
- timeout = "1m"
247
- key_file = "${var.key_file}"
248
- }
249
- inline = [
250
- "sudo hostnamectl set-hostname build-node-1"
251
- ]
252
- }
253
- }
254
-
255
- resource "aws_instance" "workstation" {
256
- ami = "${var.ami-workstation}"
257
- availability_zone = "${var.az}"
258
- instance_type = "m3.large"
259
- key_name = "${var.key_name}"
260
- subnet_id = "${aws_subnet.automate.id}"
261
- vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
262
- associate_public_ip_address = true
263
- private_ip = "172.31.54.101"
264
-
265
- tags {
266
- "Customer" = "${var.customer}"
267
- "Name" = "wombat windows workstation"
268
- "TTL" = "${var.ttl}"
269
- }
270
- }
271
-
272
- resource "aws_security_group" "wombat" {
273
- description = "Enable required ports for Chef Server"
274
- vpc_id = "${aws_vpc.wombat.id}"
275
-
276
- ingress {
277
- from_port = 0
278
- to_port = 65535
279
- protocol = "tcp"
280
- cidr_blocks = ["172.31.0.0/16"]
281
- }
282
-
283
- ingress {
284
- from_port = 22
285
- to_port = 22
286
- protocol = "tcp"
287
- cidr_blocks = ["0.0.0.0/0"]
288
- }
289
-
290
- ingress {
291
- from_port = 3389
292
- to_port = 3389
293
- protocol = "udp"
294
- cidr_blocks = ["0.0.0.0/0"]
295
- }
296
-
297
- ingress {
298
- from_port = 3389
299
- to_port = 3389
300
- protocol = "tcp"
301
- cidr_blocks = ["0.0.0.0/0"]
302
- }
303
-
304
- ingress {
305
- from_port = 8
306
- to_port = -1
307
- protocol = "icmp"
308
- cidr_blocks = ["0.0.0.0/0"]
309
- }
310
-
311
-
312
- egress {
313
- from_port = 0
314
- to_port = 0
315
- protocol = "-1"
316
- cidr_blocks = ["0.0.0.0/0"]
317
- }
318
-
319
- tags {
320
- "Customer" = "${var.customer}"
321
- "Name" = "wombat security group"
322
- "TTL" = "${var.ttl}"
323
- }
324
- }
325
-
326
- output "workstation" {
327
- value = "${aws_instance.workstation.public_ip}"
328
- }
1
+ variable "access_key" {}
2
+ variable "secret_key" {}
3
+ variable "region" {
4
+ default = "us-west-2"
5
+ }
6
+ variable "az" {
7
+ default = "us-west-2c"
8
+ }
9
+ variable "customer" {
10
+ default = "venture-industries"
11
+ }
12
+ variable "key_file" {
13
+ default = "../packer/keys/private.pem"
14
+ }
15
+ variable "key_name" {
16
+ default = "USER_REGION"
17
+ }
18
+ variable "ttl" {
19
+ default = 8
20
+ }
21
+ variable "num_builders" {
22
+ default = 0
23
+ }
24
+ variable "ami-chef-server" {
25
+ default = "ami-f3f10893"
26
+ }
27
+ variable "ami-automate" {
28
+ default = "ami-6abf460a"
29
+ }
30
+ variable "ami-build-node" {
31
+ default = "ami-8c4cb0ec"
32
+ }
33
+ variable "ami-workstation" {
34
+ default = "ami-e8f90088"
35
+ }
36
+
37
+ provider "aws" {
38
+ access_key = "${var.access_key}"
39
+ secret_key = "${var.secret_key}"
40
+ region = "${var.region}"
41
+ }
42
+
43
+ resource "aws_vpc" "wombat" {
44
+ cidr_block = "172.31.0.0/16"
45
+ enable_dns_hostnames = true
46
+ enable_dns_support = true
47
+ instance_tenancy = "default"
48
+
49
+ tags {
50
+ "Customer" = "${var.customer}"
51
+ "TTL" = "${var.ttl}"
52
+ "Name" = "wombat VPC"
53
+ }
54
+ }
55
+
56
+ resource "aws_subnet" "automate" {
57
+ vpc_id = "${aws_vpc.wombat.id}"
58
+ cidr_block = "172.31.54.0/24"
59
+ availability_zone = "${var.az}"
60
+ map_public_ip_on_launch = false
61
+
62
+ tags {
63
+ "Customer" = "${var.customer}"
64
+ "TTL" = "${var.ttl}"
65
+ "Name" = "${var.customer} wombat automate Subnet"
66
+ }
67
+ }
68
+
69
+ resource "aws_subnet" "prod" {
70
+ vpc_id = "${aws_vpc.wombat.id}"
71
+ cidr_block = "172.31.62.0/24"
72
+ availability_zone = "${var.az}"
73
+ map_public_ip_on_launch = false
74
+
75
+ tags {
76
+ "Customer" = "${var.customer}"
77
+ "TTL" = "${var.ttl}"
78
+ "Name" = "wombat prod subnet"
79
+ }
80
+ }
81
+
82
+ resource "aws_subnet" "workstations" {
83
+ vpc_id = "${aws_vpc.wombat.id}"
84
+ cidr_block = "172.31.10.0/24"
85
+ availability_zone = "${var.az}"
86
+ map_public_ip_on_launch = false
87
+
88
+ tags {
89
+ "Customer" = "${var.customer}"
90
+ "TTL" = "${var.ttl}"
91
+ "Name" = "wombat workstations subnet"
92
+ }
93
+ }
94
+
95
+ resource "aws_internet_gateway" "inet-gw" {
96
+ vpc_id = "${aws_vpc.wombat.id}"
97
+
98
+ tags {
99
+ "Customer" = "${var.customer}"
100
+ "Name" = "wombat IG"
101
+ "TTL" = "${var.ttl}"
102
+ }
103
+ }
104
+
105
+ resource "aws_route_table" "route-table" {
106
+ vpc_id = "${aws_vpc.wombat.id}"
107
+
108
+ route {
109
+ cidr_block = "0.0.0.0/0"
110
+ gateway_id = "${aws_internet_gateway.inet-gw.id}"
111
+ }
112
+
113
+ tags {
114
+ "Customer" = "${var.customer}"
115
+ "Name" = "wombat RouteTable"
116
+ "TTL" = "${var.ttl}"
117
+ }
118
+ }
119
+
120
+ resource "aws_route_table_association" "automate-rta" {
121
+ route_table_id = "${aws_route_table.route-table.id}"
122
+ subnet_id = "${aws_subnet.automate.id}"
123
+ }
124
+
125
+ resource "aws_route_table_association" "prod-rta" {
126
+ route_table_id = "${aws_route_table.route-table.id}"
127
+ subnet_id = "${aws_subnet.prod.id}"
128
+ }
129
+
130
+ resource "aws_route_table_association" "workstations-rta" {
131
+ route_table_id = "${aws_route_table.route-table.id}"
132
+ subnet_id = "${aws_subnet.workstations.id}"
133
+ }
134
+
135
+ resource "aws_network_acl" "wombat-network-acl" {
136
+ vpc_id = "${aws_vpc.wombat.id}"
137
+ subnet_ids = ["${aws_subnet.automate.id}", "${aws_subnet.prod.id}", "${aws_subnet.workstations.id}"]
138
+
139
+ ingress {
140
+ from_port = 0
141
+ to_port = 0
142
+ rule_no = 100
143
+ action = "allow"
144
+ protocol = "-1"
145
+ cidr_block = "0.0.0.0/0"
146
+ }
147
+
148
+ egress {
149
+ from_port = 0
150
+ to_port = 0
151
+ rule_no = 100
152
+ action = "allow"
153
+ protocol = "-1"
154
+ cidr_block = "0.0.0.0/0"
155
+ }
156
+
157
+ tags {
158
+ "Customer" = "${var.customer}"
159
+ "TTL" = "${var.ttl}"
160
+ "Name" = "wombat NetworkAcl"
161
+ }
162
+ }
163
+
164
+ resource "aws_instance" "chef-server" {
165
+ ami = "${var.ami-chef-server}"
166
+ availability_zone = "${var.az}"
167
+ instance_type = "c3.xlarge"
168
+ key_name = "${var.key_name}"
169
+ subnet_id = "${aws_subnet.automate.id}"
170
+ vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
171
+ associate_public_ip_address = false
172
+ private_ip = "172.31.54.10"
173
+
174
+ tags {
175
+ "Customer" = "${var.customer}"
176
+ "Name" = "wombat chef server"
177
+ "TTL" = "${var.ttl}"
178
+ }
179
+
180
+ provisioner "remote-exec" {
181
+ connection {
182
+ user = "ubuntu"
183
+ host = "${aws_instance.chef-server.public_ip}"
184
+ timeout = "1m"
185
+ key_file = "${var.key_file}"
186
+ }
187
+ inline = [
188
+ "sudo hostnamectl set-hostname chef-server",
189
+ "sudo chef-server-ctl reconfigure",
190
+ "sudo chef-manage-ctl reconfigure",
191
+ "sudo opscode-push-jobs-server-ctl reconfigure"
192
+ ]
193
+ }
194
+ }
195
+
196
+ resource "aws_instance" "automate" {
197
+ ami = "${var.ami-automate}"
198
+ availability_zone = "${var.az}"
199
+ instance_type = "c3.xlarge"
200
+ key_name = "${var.key_name}"
201
+ subnet_id = "${aws_subnet.automate.id}"
202
+ vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
203
+ associate_public_ip_address = false
204
+ private_ip = "172.31.54.11"
205
+
206
+ tags {
207
+ "Customer" = "${var.customer}"
208
+ "Name" = "wombat automate server"
209
+ "TTL" = "${var.ttl}"
210
+ }
211
+
212
+ provisioner "remote-exec" {
213
+ connection {
214
+ user = "ubuntu"
215
+ host = "${aws_instance.automate.public_ip}"
216
+ timeout = "1m"
217
+ key_file = "${var.key_file}"
218
+ }
219
+ inline = [
220
+ "sudo hostnamectl set-hostname automate",
221
+ "sudo automate-ctl reconfigure"
222
+ ]
223
+ }
224
+ }
225
+
226
+ resource "aws_instance" "build-node-1" {
227
+ ami = "${var.ami-build-node}"
228
+ availability_zone = "${var.az}"
229
+ instance_type = "c3.large"
230
+ key_name = "${var.key_name}"
231
+ subnet_id = "${aws_subnet.automate.id}"
232
+ vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
233
+ associate_public_ip_address = false
234
+ private_ip = "172.31.54.12"
235
+
236
+ tags {
237
+ "Customer" = "${var.customer}"
238
+ "Name" = "wombat automate build node 1"
239
+ "TTL" = "${var.ttl}"
240
+ }
241
+
242
+ provisioner "remote-exec" {
243
+ connection {
244
+ user = "ubuntu"
245
+ host = "${aws_instance.automate.public_ip}"
246
+ timeout = "1m"
247
+ key_file = "${var.key_file}"
248
+ }
249
+ inline = [
250
+ "sudo hostnamectl set-hostname build-node-1"
251
+ ]
252
+ }
253
+ }
254
+
255
+ resource "aws_instance" "workstation" {
256
+ ami = "${var.ami-workstation}"
257
+ availability_zone = "${var.az}"
258
+ instance_type = "m3.large"
259
+ key_name = "${var.key_name}"
260
+ subnet_id = "${aws_subnet.automate.id}"
261
+ vpc_security_group_ids = ["${aws_security_group.wombat.id}"]
262
+ associate_public_ip_address = true
263
+ private_ip = "172.31.54.101"
264
+
265
+ tags {
266
+ "Customer" = "${var.customer}"
267
+ "Name" = "wombat windows workstation"
268
+ "TTL" = "${var.ttl}"
269
+ }
270
+ }
271
+
272
+ resource "aws_security_group" "wombat" {
273
+ description = "Enable required ports for Chef Server"
274
+ vpc_id = "${aws_vpc.wombat.id}"
275
+
276
+ ingress {
277
+ from_port = 0
278
+ to_port = 65535
279
+ protocol = "tcp"
280
+ cidr_blocks = ["172.31.0.0/16"]
281
+ }
282
+
283
+ ingress {
284
+ from_port = 22
285
+ to_port = 22
286
+ protocol = "tcp"
287
+ cidr_blocks = ["0.0.0.0/0"]
288
+ }
289
+
290
+ ingress {
291
+ from_port = 3389
292
+ to_port = 3389
293
+ protocol = "udp"
294
+ cidr_blocks = ["0.0.0.0/0"]
295
+ }
296
+
297
+ ingress {
298
+ from_port = 3389
299
+ to_port = 3389
300
+ protocol = "tcp"
301
+ cidr_blocks = ["0.0.0.0/0"]
302
+ }
303
+
304
+ ingress {
305
+ from_port = 8
306
+ to_port = -1
307
+ protocol = "icmp"
308
+ cidr_blocks = ["0.0.0.0/0"]
309
+ }
310
+
311
+
312
+ egress {
313
+ from_port = 0
314
+ to_port = 0
315
+ protocol = "-1"
316
+ cidr_blocks = ["0.0.0.0/0"]
317
+ }
318
+
319
+ tags {
320
+ "Customer" = "${var.customer}"
321
+ "Name" = "wombat security group"
322
+ "TTL" = "${var.ttl}"
323
+ }
324
+ }
325
+
326
+ output "workstation" {
327
+ value = "${aws_instance.workstation.public_ip}"
328
+ }