zergrush 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f924664a04bc1e0605d12801bca3741380730040
4
+ data.tar.gz: 4a9616f8ce6752c06e2e659a8d08b13f43a43b51
5
+ SHA512:
6
+ metadata.gz: 9df78ac67d6dd997b3b3882f822501ab0aa51df9962a15ddf47257cca166fb526236ccd1c9644adf4db96e4270811023b703fffb76260959e2062e8348977a56
7
+ data.tar.gz: 0b1d6fa697102325d58567390bab7b17a82dccafa8270bd96eca3a50b31e417276c1c7c7c62388c8ffaa040669d683ac2db304d55c049aafb8f5a5ccbf03b914
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ pkg
2
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in zerg.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ zergrush (0.0.1)
5
+ awesome_print
6
+ highline
7
+ json-schema
8
+ thor
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ aruba (0.5.4)
14
+ childprocess (>= 0.3.6)
15
+ cucumber (>= 1.1.1)
16
+ rspec-expectations (>= 2.7.0)
17
+ awesome_print (1.2.0)
18
+ builder (3.2.2)
19
+ childprocess (0.4.0)
20
+ ffi (~> 1.0, >= 1.0.11)
21
+ cucumber (1.3.10)
22
+ builder (>= 2.1.2)
23
+ diff-lcs (>= 1.1.3)
24
+ gherkin (~> 2.12)
25
+ multi_json (>= 1.7.5, < 2.0)
26
+ multi_test (>= 0.0.2)
27
+ diff-lcs (1.2.5)
28
+ ffi (1.9.3)
29
+ gherkin (2.12.2)
30
+ multi_json (~> 1.3)
31
+ highline (1.6.20)
32
+ json-schema (2.1.3)
33
+ multi_json (1.8.4)
34
+ multi_test (0.0.3)
35
+ rake (10.1.1)
36
+ rspec (2.14.1)
37
+ rspec-core (~> 2.14.0)
38
+ rspec-expectations (~> 2.14.0)
39
+ rspec-mocks (~> 2.14.0)
40
+ rspec-core (2.14.7)
41
+ rspec-expectations (2.14.4)
42
+ diff-lcs (>= 1.1.3, < 2.0)
43
+ rspec-mocks (2.14.4)
44
+ thor (0.18.1)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ aruba
51
+ bundler (>= 1.0.0)
52
+ cucumber
53
+ rake
54
+ rspec (~> 2.6)
55
+ zergrush!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 MTN Sattelite Communications
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/zerg ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'zerg/cli'
3
+ Zerg::CLI.start
@@ -0,0 +1 @@
1
+ <%= machine_name %>.vm.network :public_network, :bridge => "<%= bridged_eth_description %>", :mac => <%= machine_mac %>, :use_dhcp_assigned_default_route => true
@@ -0,0 +1 @@
1
+ <%= machine_name %>.vm.network :private_network, ip: "192.168.50.<%= last_octet %>"
@@ -0,0 +1,22 @@
1
+ # define the machine name
2
+ config.vm.define "<%= machine_name %>" do |<%= machine_name %>|
3
+ <%= bridge_specifics -%>
4
+ <%= hostonly_specifics %>
5
+ <%= sync_folders_array -%>
6
+
7
+ # provisioning
8
+ tasks = JSON.parse(<%= tasks_array %>)
9
+ tasks.each { |task|
10
+ if task["type"] == "chef_client" || task["type"] == "chef_solo"
11
+ <%= machine_name %>.omnibus.chef_version = :latest
12
+ end
13
+
14
+ <%= machine_name %>.vm.provision "#{task["type"]}" do |provisioner|
15
+ task.each do |key, value|
16
+ next if key == "type"
17
+ provisioner.send("#{key}=", value)
18
+ end
19
+ end
20
+ }
21
+ end
22
+
@@ -0,0 +1,11 @@
1
+ Vagrant.configure(2) do |config|
2
+ <%= provider_section %>
3
+
4
+ config.vagrant.host = :detect
5
+ config.vm.box_url = "<%= basebox_path %>"
6
+ config.vm.box = "<%= box_name %>"
7
+ config.vm.boot_timeout = 300
8
+ config.vm.graceful_halt_timeout = 60
9
+ <%= vm_defines -%>
10
+
11
+ end
@@ -0,0 +1,3 @@
1
+ config.vm.provider :<%= provider %> do |<%= provider %>, override|
2
+ <%= provider_specifics -%>
3
+ end
data/data/ke.schema ADDED
@@ -0,0 +1,325 @@
1
+ {
2
+ "type": "object",
3
+ "id": "com.mtnsat.zerg.json.ke",
4
+ "properties": {
5
+ "instances": {
6
+ "type": "integer",
7
+ "id": "com.mtnsat.zerg.json.ke.instances",
8
+ "minimum": 0
9
+ },
10
+ "ram_per_vm": {
11
+ "type": "integer",
12
+ "id": "com.mtnsat.zerg.json.ke.ram_per_vm",
13
+ "minimum": 256
14
+ },
15
+ "synced_folders": {
16
+ "type": "array",
17
+ "id": "com.mtnsat.zerg.json.ke.tasks",
18
+ "items": {
19
+ "properties": {
20
+ "host_path": {
21
+ "type": "string",
22
+ "id": "com.mtnsat.zerg.json.ke.synced_folder.item.host_path"
23
+ },
24
+ "guest_path": {
25
+ "type": "string",
26
+ "id": "com.mtnsat.zerg.json.ke.synced_folder.item.guest_path"
27
+ },
28
+ "options": {
29
+ "type": "array",
30
+ "id": "com.mtnsat.zerg.json.ke.synced_folder.item.options"
31
+ }
32
+ },
33
+ "required": [
34
+ "host_path",
35
+ "guest_path"
36
+ ],
37
+ "additionalProperties": false
38
+ }
39
+ },
40
+ "tasks": {
41
+ "type": "array",
42
+ "id": "com.mtnsat.zerg.json.ke.tasks",
43
+ "minItems": 1,
44
+ "items": {
45
+ "properties": {
46
+ "type": {
47
+ "type": "string",
48
+ "pattern": "^(shell|chef_client|chef_solo)$",
49
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.type"
50
+ },
51
+ "inline": {
52
+ "type": "string",
53
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.inline"
54
+ },
55
+ "path": {
56
+ "type": "string",
57
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.path"
58
+ },
59
+ "parameters": {
60
+ "type": "string",
61
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.parameters"
62
+ },
63
+ "environment": {
64
+ "type": "string",
65
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.environment"
66
+ },
67
+ "upload_path": {
68
+ "type": "string",
69
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.upload_path"
70
+ },
71
+ "recipe_url": {
72
+ "type": "string",
73
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.recipe_url"
74
+ },
75
+ "client_key_path": {
76
+ "type": "string",
77
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.client_key_path"
78
+ },
79
+ "validation_client_name": {
80
+ "type": "string",
81
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.validation_client_name"
82
+ },
83
+ "arguments": {
84
+ "type": "string",
85
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.arguments"
86
+ },
87
+ "chef_server_url": {
88
+ "type": "string",
89
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.chef_server_url"
90
+ },
91
+ "validation_key_path": {
92
+ "type": "string",
93
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.validation_key_path"
94
+ },
95
+ "encrypted_data_bag_secret_key_path": {
96
+ "type": "string",
97
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.encrypted_data_bag_secret_key_path"
98
+ },
99
+ "binary_path": {
100
+ "type": "string",
101
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.binary_path"
102
+ },
103
+ "custom_config_path": {
104
+ "type": "string",
105
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.custom_config_path"
106
+ },
107
+ "formatter": {
108
+ "type": "string",
109
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.formatter"
110
+ },
111
+ "http_proxy": {
112
+ "type": "string",
113
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy"
114
+ },
115
+ "http_proxy_user": {
116
+ "type": "string",
117
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy_user"
118
+ },
119
+ "http_proxy_pass": {
120
+ "type": "string",
121
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.http_proxy_pass"
122
+ },
123
+ "no_proxy": {
124
+ "type": "string",
125
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.no_proxy"
126
+ },
127
+ "https_proxy": {
128
+ "type": "string",
129
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy"
130
+ },
131
+ "https_proxy_user": {
132
+ "type": "string",
133
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy_user"
134
+ },
135
+ "https_proxy_pass": {
136
+ "type": "string",
137
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.https_proxy_pass"
138
+ },
139
+ "log_level": {
140
+ "type": "string",
141
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.log_level"
142
+ },
143
+ "provisioning_path": {
144
+ "type": "string",
145
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.provisioning_path"
146
+ },
147
+ "file_cache_path": {
148
+ "type": "string",
149
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.file_cache_path"
150
+ },
151
+ "file_backup_path": {
152
+ "type": "string",
153
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.file_backup_path"
154
+ },
155
+ "verbose_logging": {
156
+ "type": "boolean",
157
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.verbose_logging"
158
+ },
159
+ "delete_node": {
160
+ "type": "boolean",
161
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.delete_node"
162
+ },
163
+ "delete_client": {
164
+ "type": "boolean",
165
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.delete_client"
166
+ },
167
+ "nfs": {
168
+ "type": "boolean",
169
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.nfs"
170
+ },
171
+ "binary": {
172
+ "type": "boolean",
173
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.binary"
174
+ },
175
+ "keep_color": {
176
+ "type": "boolean",
177
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.keep_color"
178
+ },
179
+ "priveleged": {
180
+ "type": "boolean",
181
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.priveleged"
182
+ },
183
+ "attempts": {
184
+ "type": "integer",
185
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.attempts"
186
+ },
187
+ "json": {
188
+ "type": "object",
189
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.json"
190
+ },
191
+ "cookbooks_path": {
192
+ "type": "array",
193
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.cookbooks_path",
194
+ "minItems": 1,
195
+ "items": [
196
+ {
197
+ "type": "string"
198
+ }
199
+ ]
200
+ },
201
+ "args": {
202
+ "type": "array",
203
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.args",
204
+ "minItems": 1,
205
+ "items": [
206
+ {
207
+ "type": "string"
208
+ }
209
+ ]
210
+ },
211
+ "roles_path": {
212
+ "type": "array",
213
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.roles_path",
214
+ "minItems": 1,
215
+ "items": [
216
+ {
217
+ "type": "string"
218
+ }
219
+ ]
220
+ },
221
+ "data_bags_path": {
222
+ "type": "array",
223
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.data_bags_path",
224
+ "minItems": 1,
225
+ "items": [
226
+ {
227
+ "type": "string"
228
+ }
229
+ ]
230
+ },
231
+ "environments_path": {
232
+ "type": "array",
233
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.environments_path",
234
+ "minItems": 1,
235
+ "items": [
236
+ {
237
+ "type": "string"
238
+ }
239
+ ]
240
+ },
241
+ "run_list": {
242
+ "type": "array",
243
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.recipes",
244
+ "minItems": 1,
245
+ "items": [
246
+ {
247
+ "type": "string"
248
+ }
249
+ ]
250
+ },
251
+ "roles": {
252
+ "type": "array",
253
+ "id": "com.mtnsat.zerg.json.ke.tasks.item.roles",
254
+ "minItems": 1,
255
+ "items": [
256
+ {
257
+ "type": "string"
258
+ }
259
+ ]
260
+ }
261
+ },
262
+ "required": [
263
+ "type"
264
+ ],
265
+ "additionalProperties": false
266
+ }
267
+ },
268
+ "vm": {
269
+ "type": "object",
270
+ "id": "com.mtnsat.zerg.json.ke.vm",
271
+ "properties": {
272
+ "driver": {
273
+ "type": "object",
274
+ "id": "com.mtnsat.zerg.json.ke.vm.driver",
275
+ "properties": {
276
+ "drivertype": {
277
+ "type": "string",
278
+ "id": "com.mtnsat.zerg.json.ke.vm.driver.drivertype",
279
+ "pattern": "^(vagrant)$"
280
+ },
281
+ "providertype": {
282
+ "type": "string",
283
+ "id": "com.mtnsat.zerg.json.ke.vm.driver.providertype",
284
+ "pattern": "^(virtualbox|aws|libvirt)$"
285
+ },
286
+ "provider_options": {
287
+ "type": "array",
288
+ "id": "com.mtnsat.zerg.json.ke.vm.driver.provider_options"
289
+ }
290
+ },
291
+ "required": [
292
+ "drivertype",
293
+ "providertype",
294
+ "provider_options"
295
+ ],
296
+ "additionalProperties": false
297
+ },
298
+ "private_network": {
299
+ "type": "boolean",
300
+ "id": "com.mtnsat.zerg.json.ke.vm.private_network"
301
+ },
302
+ "basebox": {
303
+ "type": "string",
304
+ "id": "com.mtnsat.zerg.json.ke.vm.basebox"
305
+ },
306
+ "bridge_description": {
307
+ "type": "string",
308
+ "id": "com.mtnsat.zerg.json.ke.vm.bridge_description"
309
+ }
310
+ },
311
+ "required": [
312
+ "driver",
313
+ "private_network",
314
+ "basebox"
315
+ ],
316
+ "additionalProperties": false
317
+ }
318
+ },
319
+ "required": [
320
+ "instances",
321
+ "tasks",
322
+ "vm"
323
+ ],
324
+ "additionalProperties": false
325
+ }