elevage 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +21 -0
  4. data/.rubocop.yml +8 -0
  5. data/.ruby-version +1 -0
  6. data/.simplecov +8 -0
  7. data/.travis.yml +3 -0
  8. data/.yardoc/checksums +12 -0
  9. data/.yardoc/object_types +0 -0
  10. data/.yardoc/objects/root.dat +0 -0
  11. data/.yardoc/proxy_types +0 -0
  12. data/Gemfile +4 -0
  13. data/Guardfile +10 -0
  14. data/LICENSE.txt +203 -0
  15. data/README.md +112 -0
  16. data/Rakefile +20 -0
  17. data/bin/elevage +4 -0
  18. data/coverage/.resultset.json.lock +0 -0
  19. data/doc/Elevage/Build.html +435 -0
  20. data/doc/Elevage/CLI.html +282 -0
  21. data/doc/Elevage/Environment.html +950 -0
  22. data/doc/Elevage/Generate.html +346 -0
  23. data/doc/Elevage/Health.html +359 -0
  24. data/doc/Elevage/New.html +411 -0
  25. data/doc/Elevage/Platform.html +1119 -0
  26. data/doc/Elevage/Provisioner.html +804 -0
  27. data/doc/Elevage/ProvisionerRunQueue.html +765 -0
  28. data/doc/Elevage/Runner.html +319 -0
  29. data/doc/Elevage.html +501 -0
  30. data/doc/_index.html +239 -0
  31. data/doc/class_list.html +58 -0
  32. data/doc/css/common.css +1 -0
  33. data/doc/css/full_list.css +57 -0
  34. data/doc/css/style.css +339 -0
  35. data/doc/file.README.html +187 -0
  36. data/doc/file_list.html +60 -0
  37. data/doc/frames.html +26 -0
  38. data/doc/index.html +187 -0
  39. data/doc/js/app.js +219 -0
  40. data/doc/js/full_list.js +181 -0
  41. data/doc/js/jquery.js +4 -0
  42. data/doc/method_list.html +369 -0
  43. data/doc/top-level-namespace.html +112 -0
  44. data/elevage.gemspec +39 -0
  45. data/features/archive +314 -0
  46. data/features/build.feature +237 -0
  47. data/features/elevage.feature +24 -0
  48. data/features/generate.feature +235 -0
  49. data/features/health_env_failure.feature +292 -0
  50. data/features/health_failure.feature +291 -0
  51. data/features/health_success.feature +279 -0
  52. data/features/list.feature +315 -0
  53. data/features/new.feature +68 -0
  54. data/features/step_definitions/elevage_steps.rb +27 -0
  55. data/features/support/env.rb +9 -0
  56. data/lib/elevage/build.rb +109 -0
  57. data/lib/elevage/constants.rb +113 -0
  58. data/lib/elevage/environment.rb +223 -0
  59. data/lib/elevage/generate.rb +48 -0
  60. data/lib/elevage/health.rb +27 -0
  61. data/lib/elevage/new.rb +30 -0
  62. data/lib/elevage/platform.rb +105 -0
  63. data/lib/elevage/provisioner.rb +169 -0
  64. data/lib/elevage/provisionerrunqueue.rb +114 -0
  65. data/lib/elevage/runner.rb +39 -0
  66. data/lib/elevage/templates/compute.yml.tt +18 -0
  67. data/lib/elevage/templates/environment.yml.tt +20 -0
  68. data/lib/elevage/templates/network.yml.tt +16 -0
  69. data/lib/elevage/templates/platform.yml.tt +110 -0
  70. data/lib/elevage/templates/vcenter.yml.tt +77 -0
  71. data/lib/elevage/version.rb +4 -0
  72. data/lib/elevage.rb +45 -0
  73. data/spec/spec_helper.rb +4 -0
  74. metadata +357 -0
@@ -0,0 +1,291 @@
1
+ Feature: HEALTH check of erroneous platform definition file items
2
+
3
+ As an Infracoder developing a command line tool
4
+ I want to be able to diagnose the syntactical health of the standard platform definition and environment definition yml files
5
+ In order to maintain the health of the elevage platform definition files
6
+
7
+ Scenario: check health of standard desired state items
8
+
9
+ Given a file named "platform.yml" with:
10
+ """
11
+ platform:
12
+ name: app
13
+ description: 'description of the app'
14
+
15
+ environments:
16
+ -
17
+ - prod
18
+
19
+ tiers:
20
+ -
21
+ - App
22
+
23
+ nodenameconvention:
24
+ - environment
25
+ - '-'
26
+ - component
27
+ - '-'
28
+ -
29
+ - geo
30
+
31
+ pools:
32
+ webvmdefaults: &webvmdefaults
33
+ count: 2
34
+ tier: Web
35
+ image: 'centos-6.5-x86_64-20140714'
36
+ compute: nonprodweb
37
+ port: 80
38
+ runlist:
39
+ - 'role[loc_uswest]'
40
+ - 'role[base]'
41
+ componentrole: 'role[#]'
42
+
43
+ appvmdefaults: &appvmdefaults
44
+ <<: *webvmdefaults
45
+ count:
46
+ tier:
47
+ image:
48
+ port:
49
+ runlist:
50
+ -
51
+ componentrole: 'role[unknown]'
52
+ compute: unknown
53
+
54
+ components:
55
+ api:
56
+ <<: *webvmdefaults
57
+ port: 8080
58
+
59
+ cui:
60
+ <<: *webvmdefaults
61
+ port: 8082
62
+
63
+ terracotta:
64
+ <<: *webvmdefaults
65
+ compute: nonprodtc
66
+ image: 'centos32g-6.5-x86_64-20140714'
67
+
68
+ email:
69
+ <<: *appvmdefaults
70
+ port: 8130
71
+
72
+ mq:
73
+ <<: *appvmdefaults
74
+ port: 1234
75
+ compute: nonprodmq
76
+ image: 'centos32g-6.5-x86_64-20140714'
77
+ """
78
+ Given a file named "infrastructure/vcenter.yml" with:
79
+ """
80
+ vcenter:
81
+ prod: &vcenter
82
+ geo:
83
+ timezone: 200
84
+
85
+ host: 'vcwest.corp.local'
86
+ datacenter:
87
+ imagefolder:
88
+ destfolder:
89
+ resourcepool:
90
+ appendenv: incorrect
91
+ appenddomain:
92
+ datastores:
93
+ -
94
+
95
+ domain:
96
+ dnsips:
97
+ -
98
+ """
99
+ Given a file named "infrastructure/network.yml" with:
100
+ """
101
+ network:
102
+ devweb:
103
+ vlanid: DEV_WEB_NET
104
+ gateway: 999.10.128.1
105
+ netmask: 19
106
+
107
+ devapp:
108
+ vlanid: DEV_APP_NET
109
+ gateway: 10.10.160.1
110
+ netmask: 20
111
+
112
+ prodweb:
113
+ vlanid: PRD_WEB_NET
114
+ gateway: 10.119.128.1
115
+ netmask: 19
116
+
117
+ prodapp:
118
+ vlanid: PRD_APP_NET
119
+ gateway: 10.119.160.1
120
+ netmask: 20
121
+ """
122
+ Given a file named "infrastructure/compute.yml" with:
123
+ """
124
+ compute:
125
+ default: &default
126
+ cpu: 2
127
+ ram: 2
128
+
129
+ nonprodweb:
130
+ <<: *default
131
+
132
+ nonprodapp:
133
+ <<: *default
134
+ ram: 6
135
+
136
+ nonprodtc:
137
+ <<: *default
138
+ ram: 8
139
+
140
+ nonprodmq:
141
+ <<: *default
142
+ ram: 12
143
+
144
+ prodweb:
145
+ <<: *default
146
+ ram: 6
147
+
148
+ prodapp:
149
+ <<: *default
150
+ ram: 6
151
+
152
+ prodtc:
153
+ <<: *default
154
+ ram: 32
155
+
156
+ prodmq:
157
+ <<: *default
158
+ cpu: 99
159
+ ram: 999
160
+ """
161
+ Given a file named "environments/int.yml" with:
162
+ """
163
+ environment:
164
+ vcenter: nonprod
165
+
166
+ pool:
167
+ webvmdefaults: &webvmdefaults
168
+ network: devweb
169
+ compute: nonprodweb
170
+
171
+ appvmdefaults: &appvmdefaults
172
+ <<: *webvmdefaults
173
+ network: devapp
174
+ compute: nonprodapp
175
+
176
+ components:
177
+ api:
178
+ <<: *webvmdefaults
179
+ addresses:
180
+ - 10.10.137.42
181
+ - 10.10.137.43
182
+
183
+ cui:
184
+ <<: *webvmdefaults
185
+ addresses:
186
+ - 10.10.137.64
187
+ - 10.10.137.65
188
+
189
+ terracotta:
190
+ <<: *webvmdefaults
191
+ addresses:
192
+ - 10.10.137.95
193
+ - 10.10.137.96
194
+
195
+ email:
196
+ <<: *appvmdefaults
197
+ addresses:
198
+ - 10.10.161.53
199
+ - 10.10.161.54
200
+
201
+ mq:
202
+ <<: *appvmdefaults
203
+ addresses:
204
+ - 10.10.161.77
205
+ - 10.10.161.78
206
+ """
207
+ Given a file named "environments/prod.yml" with:
208
+ """
209
+ environment:
210
+ vcenter: prod
211
+
212
+ pool:
213
+ webvmdefaults: &webvmdefaults
214
+ network: prodweb
215
+ count: 4
216
+ compute: prodweb
217
+
218
+ appvmdefaults: &appvmdefaults
219
+ <<: *webvmdefaults
220
+ network: prodapp
221
+ compute: prodapp
222
+
223
+
224
+ components:
225
+ api:
226
+ <<: *webvmdefaults
227
+ addresses:
228
+ - 10.119.137.72
229
+ - 10.119.137.73
230
+ - 10.119.137.74
231
+ - 10.119.137.75
232
+
233
+ cui:
234
+ <<: *webvmdefaults
235
+ addresses:
236
+ - 10.119.137.133
237
+ - 10.119.137.134
238
+ - 10.119.137.135
239
+ - 10.119.137.136
240
+
241
+ terracotta:
242
+ <<: *webvmdefaults
243
+ count: 2
244
+ compute: prodtc
245
+ addresses:
246
+ - 10.119.137.218
247
+ - 10.119.137.219
248
+ port: 0000
249
+
250
+ email:
251
+ <<: *appvmdefaults
252
+ addresses:
253
+ - 10.119.161.137
254
+ - 10.119.161.138
255
+ - 10.119.161.139
256
+ - 10.119.161.140
257
+
258
+ mq:
259
+ <<: *appvmdefaults
260
+ count: 2
261
+ compute: prodmq
262
+ addresses:
263
+ - 10.119.161.206
264
+ - 10.119.161.207
265
+ """
266
+ When I run `elevage health`
267
+ Then the exit status should be 1
268
+ And the output should contain "health check revealed errors"
269
+ And the output should contain "Empty environment definitions"
270
+ And the output should contain "Empty tier definitions"
271
+ And the output should contain "Empty nodenameconvention definitions"
272
+ And the output should contain "Must define 1 or more nodes in a pool"
273
+ And the output should contain "Pool contains invalid tier reference"
274
+ And the output should contain "No vm image referenced in pool definition"
275
+ And the output should contain "Pool contains invalid compute reference"
276
+ And the output should contain "Pool contains invalid port definition"
277
+ And the output should contain "No pool runlist definition"
278
+ And the output should contain "Pool Componentrole missing #"
279
+ And the output should contain "no vCenter geo defined"
280
+ And the output should contain "Invalid vCenter timezone"
281
+ And the output should contain "No datacenter defined for vCenter"
282
+ And the output should contain "No image location defined for vCenter build"
283
+ And the output should contain "No destination folder defined for vCenter build"
284
+ And the output should contain "Append environment to destination folder must be true or false"
285
+ And the output should contain "prepend app name to domain must be true or false"
286
+ And the output should contain "No data stores defined for vCenter build"
287
+ And the output should contain "No domain defined for node fqdn"
288
+ And the output should contain "Invalid IP's defined for DNS lookup"
289
+ And the output should contain "Invalid gateway defined in network"
290
+ And the output should contain "Invalid compute cpu settings"
291
+ And the output should contain "Invalid compute ram settings"
@@ -0,0 +1,279 @@
1
+ Feature: HEALTH check of correct platform definition file items
2
+
3
+ As an Infracoder developing a command line tool
4
+ I want to be able to diagnose the syntactical health of the standard platform definition and environment definition yml files
5
+ In order to maintain the health of the elevage platform definition files
6
+
7
+ Scenario: check health of standard desired state items
8
+
9
+ Given a file named "platform.yml" with:
10
+ """
11
+ platform:
12
+ name: app
13
+ description: 'description of the app'
14
+
15
+ environments:
16
+ - int
17
+ - prod
18
+
19
+ tiers:
20
+ - Web
21
+ - App
22
+
23
+ nodenameconvention:
24
+ - environment
25
+ - '-'
26
+ - component
27
+ - '-'
28
+ - instance
29
+ - geo
30
+
31
+ pools:
32
+ webvmdefaults: &webvmdefaults
33
+ count: 2
34
+ tier: Web
35
+ image: 'centos-6.5-x86_64-20140714'
36
+ compute: nonprodweb
37
+ port: 80
38
+ runlist:
39
+ - 'role[loc_uswest]'
40
+ - 'role[base]'
41
+ componentrole: 'role[#]'
42
+
43
+ appvmdefaults: &appvmdefaults
44
+ <<: *webvmdefaults
45
+ tier: App
46
+ compute: nonprodapp
47
+
48
+ components:
49
+ api:
50
+ <<: *webvmdefaults
51
+ port: 8080
52
+
53
+ cui:
54
+ <<: *webvmdefaults
55
+ port: 8082
56
+
57
+ terracotta:
58
+ <<: *webvmdefaults
59
+ compute: nonprodtc
60
+ image: 'centos32g-6.5-x86_64-20140714'
61
+
62
+ email:
63
+ <<: *appvmdefaults
64
+ port: 8130
65
+
66
+ mq:
67
+ <<: *appvmdefaults
68
+ port: 1234
69
+ compute: nonprodmq
70
+ image: 'centos32g-6.5-x86_64-20140714'
71
+ """
72
+ Given a file named "infrastructure/vcenter.yml" with:
73
+ """
74
+ vcenter:
75
+ nonprod: &vcenter
76
+ geo: west
77
+ timezone: 085
78
+
79
+ host: 'www.google.com'
80
+ datacenter: 'WCDC NonProd'
81
+ imagefolder: 'Corporate/Platform Services/Templates'
82
+ destfolder: 'Corporate/Platform Services/app'
83
+ resourcepool: 'App-Web Linux/Corporate'
84
+ appendenv: true
85
+ appenddomain: true
86
+ datastores:
87
+ - NonProd_Cor_25
88
+ - NonProd_Cor_26
89
+ - NonProd_Cor_38
90
+ - NonProd_Cor_39
91
+
92
+ domain: dev.corp.local
93
+ dnsips:
94
+ - 10.10.10.5
95
+ - 10.10.10.6
96
+
97
+ prod:
98
+ <<: *vcenter
99
+
100
+ datacenter: 'WCDC Prod'
101
+ datastores:
102
+ - Prod_Cor_03
103
+ - Prod_Cor_04
104
+
105
+ domain: corp.local
106
+ dnsips:
107
+ - 10.20.100.5
108
+ - 10.20.100.6
109
+ """
110
+ Given a file named "infrastructure/network.yml" with:
111
+ """
112
+ network:
113
+ devweb:
114
+ vlanid: DEV_WEB_NET
115
+ gateway: 10.10.128.1
116
+ netmask: 19
117
+
118
+ devapp:
119
+ vlanid: DEV_APP_NET
120
+ gateway: 10.10.160.1
121
+ netmask: 20
122
+
123
+ prodweb:
124
+ vlanid: PRD_WEB_NET
125
+ gateway: 10.119.128.1
126
+ netmask: 19
127
+
128
+ prodapp:
129
+ vlanid: PRD_APP_NET
130
+ gateway: 10.119.160.1
131
+ netmask: 20
132
+ """
133
+ Given a file named "infrastructure/compute.yml" with:
134
+ """
135
+ compute:
136
+ default: &default
137
+ cpu: 2
138
+ ram: 2
139
+
140
+ nonprodweb:
141
+ <<: *default
142
+
143
+ nonprodapp:
144
+ <<: *default
145
+ ram: 6
146
+
147
+ nonprodtc:
148
+ <<: *default
149
+ ram: 8
150
+
151
+ nonprodmq:
152
+ <<: *default
153
+ ram: 12
154
+
155
+ prodweb:
156
+ <<: *default
157
+ ram: 6
158
+
159
+ prodapp:
160
+ <<: *default
161
+ ram: 6
162
+
163
+ prodtc:
164
+ <<: *default
165
+ ram: 32
166
+
167
+ prodmq:
168
+ <<: *default
169
+ cpu: 8
170
+ ram: 32
171
+ """
172
+ Given a file named "environments/int.yml" with:
173
+ """
174
+ environment:
175
+ vcenter: nonprod
176
+
177
+ pool:
178
+ webvmdefaults: &webvmdefaults
179
+ network: devweb
180
+
181
+ appvmdefaults: &appvmdefaults
182
+ <<: *webvmdefaults
183
+ network: devapp
184
+
185
+ components:
186
+ api:
187
+ <<: *webvmdefaults
188
+ addresses:
189
+ - 10.10.137.42
190
+ - 10.10.137.43
191
+
192
+ cui:
193
+ <<: *webvmdefaults
194
+ addresses:
195
+ - 10.10.137.64
196
+ - 10.10.137.65
197
+
198
+ terracotta:
199
+ <<: *webvmdefaults
200
+ addresses:
201
+ - 10.10.137.95
202
+ - 10.10.137.96
203
+
204
+ email:
205
+ <<: *appvmdefaults
206
+ addresses:
207
+ - 10.10.161.53
208
+ - 10.10.161.54
209
+
210
+ mq:
211
+ <<: *appvmdefaults
212
+ addresses:
213
+ - 10.10.161.77
214
+ - 10.10.161.78
215
+ """
216
+ Given a file named "environments/prod.yml" with:
217
+ """
218
+ environment:
219
+ vcenter: prod
220
+
221
+ pool:
222
+ webvmdefaults: &webvmdefaults
223
+ network: prodweb
224
+ count: 4
225
+ compute: prodweb
226
+
227
+ appvmdefaults: &appvmdefaults
228
+ <<: *webvmdefaults
229
+ network: prodapp
230
+ compute: prodapp
231
+
232
+
233
+ components:
234
+ api:
235
+ <<: *webvmdefaults
236
+ addresses:
237
+ - 10.119.137.72
238
+ - 10.119.137.73
239
+ - 10.119.137.74
240
+ - 10.119.137.75
241
+
242
+ cui:
243
+ <<: *webvmdefaults
244
+ addresses:
245
+ - 10.119.137.133
246
+ - 10.119.137.134
247
+ - 10.119.137.135
248
+ - 10.119.137.136
249
+
250
+ terracotta:
251
+ <<: *webvmdefaults
252
+ count: 2
253
+ compute: prodtc
254
+ addresses:
255
+ - 10.119.137.218
256
+ - 10.119.137.219
257
+ port: 0000
258
+
259
+ email:
260
+ <<: *appvmdefaults
261
+ addresses:
262
+ - 10.119.161.137
263
+ - 10.119.161.138
264
+ - 10.119.161.139
265
+ - 10.119.161.140
266
+
267
+ mq:
268
+ <<: *appvmdefaults
269
+ count: 2
270
+ compute: prodmq
271
+ addresses:
272
+ - 10.119.161.206
273
+ - 10.119.161.207
274
+ """
275
+
276
+ When I run `elevage health`
277
+ Then the exit status should be 0
278
+ And the output should contain "All base platform desired state files created and syntactically correct"
279
+ And the output should contain "specific definition yml syntactically correct"