fhcap-cli 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/Jenkinsfile +26 -0
- data/lib/fhcap/cli.rb +2 -0
- data/lib/fhcap/component.rb +3 -3
- data/lib/fhcap/config.rb +12 -0
- data/lib/fhcap/cookbook.rb +42 -2
- data/lib/fhcap/misc.rb +8 -1
- data/lib/fhcap/repo.rb +1 -1
- data/lib/fhcap/repos_helper.rb +11 -0
- data/lib/fhcap/tasks/chef/cookbook/aws/s3_helper.rb +21 -0
- data/lib/fhcap/tasks/chef/cookbook/check_bumps.rb +109 -0
- data/lib/fhcap/tasks/chef/cookbook/list_artifacts.rb +73 -17
- data/lib/fhcap/tasks/chef/cookbook/update_attribute.rb +51 -0
- data/lib/fhcap/tasks/chef/environments/create.rb +3 -1
- data/lib/fhcap/tasks/cluster/create_environment.rb +4 -3
- data/lib/fhcap/tasks/misc/platform_bump.rb +36 -0
- data/lib/fhcap/tasks/repo/add.rb +4 -6
- data/lib/fhcap/tasks/setup.rb +7 -1
- data/lib/fhcap/version.rb +1 -1
- data/lib/fhcap.rb +1 -1
- data/spec/fhcap/tasks/chef/cookbook/check_bumps_spec.rb +33 -0
- data/templates/chef/{environment_oscp.json.erb → environment_ocp.json.erb} +16 -1
- data/templates/chef/environment_ose-single.json.erb +1 -1
- data/templates/cluster/aws/common.json.erb +22 -23
- data/templates/cluster/aws/{oscp-7node.json.erb → ocp-multi-infra.json.erb} +64 -51
- data/templates/cluster/aws/{oscp-5node.json.erb → ocp-multi.json.erb} +47 -59
- data/templates/cluster/ocp-multi-infra.json.erb +8 -0
- data/templates/cluster/ocp-multi.json.erb +8 -0
- data/templates/cluster/openstack/{oscp-7node.json.erb → ocp-multi-infra.json.erb} +0 -0
- data/templates/cluster/openstack/{oscp-5node.json.erb → ocp-multi.json.erb} +0 -0
- metadata +16 -9
- data/templates/cluster/oscp-5node.json.erb +0 -8
- data/templates/cluster/oscp-7node.json.erb +0 -8
data/lib/fhcap/tasks/setup.rb
CHANGED
@@ -8,11 +8,13 @@ module Fhcap
|
|
8
8
|
|
9
9
|
def initialize(options)
|
10
10
|
super
|
11
|
-
|
11
|
+
default_config = options[:'empty-config'] ? @config.fhcap_empty_config : @config.fhcap_config
|
12
|
+
@fhcap_config = @config.exists? ? @config.data : default_config
|
12
13
|
|
13
14
|
opts = {
|
14
15
|
repos_dir: options[:'repos-dir'],
|
15
16
|
fh_src_dir: options[:'fh-src-dir'],
|
17
|
+
knife_dir: options[:'knife-dir'],
|
16
18
|
}.delete_if { |k, v| v.nil? || v.empty? }
|
17
19
|
|
18
20
|
@fhcap_config.merge!(opts)
|
@@ -36,6 +38,10 @@ module Fhcap
|
|
36
38
|
fh_src_dir: {
|
37
39
|
msg: "Local directory where FH component src repos are checked out",
|
38
40
|
options: {:path => true}
|
41
|
+
},
|
42
|
+
knife_dir: {
|
43
|
+
msg: "Local directory where knife configuration will be stored",
|
44
|
+
options: {:path => true}
|
39
45
|
}
|
40
46
|
}
|
41
47
|
end
|
data/lib/fhcap/version.rb
CHANGED
data/lib/fhcap.rb
CHANGED
@@ -3,7 +3,7 @@ require "pathname"
|
|
3
3
|
|
4
4
|
module Fhcap
|
5
5
|
GEM_DIR = File.expand_path '..', File.dirname(__FILE__)
|
6
|
-
TEMPLATE_NAMES = %w{single core-3node mbaas-3node core-mbaas-6node core-small-9node nginx-test single-blank farm-3node farm-5node farm-single ose-single
|
6
|
+
TEMPLATE_NAMES = %w{single core-3node mbaas-3node core-mbaas-6node core-small-9node nginx-test single-blank farm-3node farm-5node farm-single ose-single ocp-multi ocp-multi-infra}.sort
|
7
7
|
|
8
8
|
class << self
|
9
9
|
def source_root
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require "fhcap/tasks/chef/cookbook/check_bumps"
|
3
|
+
|
4
|
+
describe Fhcap::Tasks::Chef::Cookbook::CheckBumps do
|
5
|
+
|
6
|
+
subject {
|
7
|
+
Fhcap::Tasks::Chef::Cookbook::CheckBumps.new(options)
|
8
|
+
}
|
9
|
+
|
10
|
+
let(:thor) do
|
11
|
+
DummyThor.new
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:config) do
|
15
|
+
{}
|
16
|
+
end
|
17
|
+
|
18
|
+
context "defaults" do
|
19
|
+
|
20
|
+
let(:options) do
|
21
|
+
{
|
22
|
+
:thor => thor,
|
23
|
+
:modified => true,
|
24
|
+
:base_branch => 'origin/master'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "#initialize" do
|
29
|
+
specify { expect(subject.base_branch).to eq('origin/master') }
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -7,8 +7,23 @@
|
|
7
7
|
"chef_type": "environment",
|
8
8
|
"default_attributes": {
|
9
9
|
"openshift": {
|
10
|
+
<%- if config[:efs_enabled] -%>
|
11
|
+
"nfs_server":{
|
12
|
+
"volume": {
|
13
|
+
"enabled": true,
|
14
|
+
"device_name": "CHANGEME:/",
|
15
|
+
"mount_point": "/data",
|
16
|
+
"fstype": "nfs4",
|
17
|
+
"options": ["nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2"]
|
18
|
+
},
|
19
|
+
"elastic_file_system": {
|
20
|
+
"enabled": true,
|
21
|
+
"hostname": "CHANGEME"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
<%- end -%>
|
10
25
|
"domain": "<%= config[:domain] %>",
|
11
|
-
"version": "3.
|
26
|
+
"version": "3.6",
|
12
27
|
"labels": {
|
13
28
|
"region": "default"
|
14
29
|
}
|
@@ -39,35 +39,34 @@
|
|
39
39
|
"security_groups": {
|
40
40
|
"ops-admin": {
|
41
41
|
"authorize_ingress": [
|
42
|
-
|
43
|
-
|
42
|
+
{
|
43
|
+
"protocols": ["icmp"],
|
44
44
|
"start": -1,
|
45
45
|
"end": -1,
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
"sources": [
|
47
|
+
"52.51.188.129"
|
48
|
+
]
|
49
|
+
},
|
50
50
|
{
|
51
51
|
"protocols": ["all"],
|
52
52
|
"start": 0,
|
53
53
|
"end": 65535,
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
]
|
54
|
+
"sources": [
|
55
|
+
"<%= @my_public_ip %>",
|
56
|
+
"46.38.161.225/32",
|
57
|
+
"52.193.17.19",
|
58
|
+
"52.48.49.57",
|
59
|
+
"13.112.69.160",
|
60
|
+
"52.50.12.70",
|
61
|
+
"52.51.188.129",
|
62
|
+
"52.62.158.176",
|
63
|
+
"52.70.198.93",
|
64
|
+
"52.86.106.110",
|
65
|
+
"54.229.76.48/32",
|
66
|
+
"78.137.150.209/32",
|
67
|
+
"79.125.117.182/32",
|
68
|
+
"149.11.36.106/32"
|
69
|
+
]
|
71
70
|
}
|
72
71
|
]
|
73
72
|
},
|
@@ -21,7 +21,7 @@
|
|
21
21
|
},
|
22
22
|
<%- end -%>
|
23
23
|
"security_groups": {
|
24
|
-
"<%= config[:environment_name] %>-
|
24
|
+
"<%= config[:environment_name] %>-ocp-master": {
|
25
25
|
"authorize_ingress": [
|
26
26
|
{
|
27
27
|
"protocols": [
|
@@ -30,10 +30,10 @@
|
|
30
30
|
"start": 0,
|
31
31
|
"end": 65535,
|
32
32
|
"groups": [
|
33
|
-
"<%= config[:environment_name] %>-
|
34
|
-
"<%= config[:environment_name] %>-
|
35
|
-
"<%= config[:environment_name] %>-
|
36
|
-
"<%= config[:environment_name] %>-
|
33
|
+
"<%= config[:environment_name] %>-ocp-master",
|
34
|
+
"<%= config[:environment_name] %>-ocp-node",
|
35
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
36
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
37
37
|
]
|
38
38
|
},
|
39
39
|
{
|
@@ -43,10 +43,10 @@
|
|
43
43
|
"start": -1,
|
44
44
|
"end": -1,
|
45
45
|
"groups": [
|
46
|
-
"<%= config[:environment_name] %>-
|
47
|
-
"<%= config[:environment_name] %>-
|
48
|
-
"<%= config[:environment_name] %>-
|
49
|
-
"<%= config[:environment_name] %>-
|
46
|
+
"<%= config[:environment_name] %>-ocp-master",
|
47
|
+
"<%= config[:environment_name] %>-ocp-node",
|
48
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
49
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
50
50
|
]
|
51
51
|
},
|
52
52
|
{
|
@@ -61,7 +61,7 @@
|
|
61
61
|
}
|
62
62
|
]
|
63
63
|
},
|
64
|
-
"<%= config[:environment_name] %>-
|
64
|
+
"<%= config[:environment_name] %>-ocp-node": {
|
65
65
|
"authorize_ingress": [
|
66
66
|
{
|
67
67
|
"protocols": [
|
@@ -70,10 +70,10 @@
|
|
70
70
|
"start": 0,
|
71
71
|
"end": 65535,
|
72
72
|
"groups": [
|
73
|
-
"<%= config[:environment_name] %>-
|
74
|
-
"<%= config[:environment_name] %>-
|
75
|
-
"<%= config[:environment_name] %>-
|
76
|
-
"<%= config[:environment_name] %>-
|
73
|
+
"<%= config[:environment_name] %>-ocp-master",
|
74
|
+
"<%= config[:environment_name] %>-ocp-node",
|
75
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
76
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
77
77
|
]
|
78
78
|
},
|
79
79
|
{
|
@@ -83,15 +83,15 @@
|
|
83
83
|
"start": -1,
|
84
84
|
"end": -1,
|
85
85
|
"groups": [
|
86
|
-
"<%= config[:environment_name] %>-
|
87
|
-
"<%= config[:environment_name] %>-
|
88
|
-
"<%= config[:environment_name] %>-
|
89
|
-
"<%= config[:environment_name] %>-
|
86
|
+
"<%= config[:environment_name] %>-ocp-master",
|
87
|
+
"<%= config[:environment_name] %>-ocp-node",
|
88
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
89
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
90
90
|
]
|
91
91
|
}
|
92
92
|
]
|
93
93
|
},
|
94
|
-
"<%= config[:environment_name] %>-
|
94
|
+
"<%= config[:environment_name] %>-ocp-lb": {
|
95
95
|
"authorize_ingress": [
|
96
96
|
{
|
97
97
|
"protocols": [
|
@@ -102,10 +102,20 @@
|
|
102
102
|
"sources": [
|
103
103
|
"0.0.0.0/0"
|
104
104
|
]
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"protocols": [
|
108
|
+
"tcp"
|
109
|
+
],
|
110
|
+
"start": 443,
|
111
|
+
"end": 443,
|
112
|
+
"sources": [
|
113
|
+
"0.0.0.0/0"
|
114
|
+
]
|
105
115
|
}
|
106
116
|
]
|
107
117
|
},
|
108
|
-
"<%= config[:environment_name] %>-
|
118
|
+
"<%= config[:environment_name] %>-ocp-nfs": {
|
109
119
|
"authorize_ingress": [
|
110
120
|
{
|
111
121
|
"protocols": [
|
@@ -114,10 +124,10 @@
|
|
114
124
|
"start": 0,
|
115
125
|
"end": 65535,
|
116
126
|
"groups": [
|
117
|
-
"<%= config[:environment_name] %>-
|
118
|
-
"<%= config[:environment_name] %>-
|
119
|
-
"<%= config[:environment_name] %>-
|
120
|
-
"<%= config[:environment_name] %>-
|
127
|
+
"<%= config[:environment_name] %>-ocp-master",
|
128
|
+
"<%= config[:environment_name] %>-ocp-node",
|
129
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
130
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
121
131
|
]
|
122
132
|
},
|
123
133
|
{
|
@@ -127,15 +137,15 @@
|
|
127
137
|
"start": -1,
|
128
138
|
"end": -1,
|
129
139
|
"groups": [
|
130
|
-
"<%= config[:environment_name] %>-
|
131
|
-
"<%= config[:environment_name] %>-
|
132
|
-
"<%= config[:environment_name] %>-
|
133
|
-
"<%= config[:environment_name] %>-
|
140
|
+
"<%= config[:environment_name] %>-ocp-master",
|
141
|
+
"<%= config[:environment_name] %>-ocp-node",
|
142
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
143
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
134
144
|
]
|
135
145
|
}
|
136
146
|
]
|
137
147
|
},
|
138
|
-
"<%= config[:environment_name] %>-
|
148
|
+
"<%= config[:environment_name] %>-ocp-infra": {
|
139
149
|
"authorize_ingress": [
|
140
150
|
{
|
141
151
|
"protocols": [
|
@@ -144,11 +154,11 @@
|
|
144
154
|
"start": 0,
|
145
155
|
"end": 65535,
|
146
156
|
"groups": [
|
147
|
-
"<%= config[:environment_name] %>-
|
148
|
-
"<%= config[:environment_name] %>-
|
149
|
-
"<%= config[:environment_name] %>-
|
150
|
-
"<%= config[:environment_name] %>-
|
151
|
-
"<%= config[:environment_name] %>-
|
157
|
+
"<%= config[:environment_name] %>-ocp-master",
|
158
|
+
"<%= config[:environment_name] %>-ocp-node",
|
159
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
160
|
+
"<%= config[:environment_name] %>-ocp-lb",
|
161
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
152
162
|
]
|
153
163
|
},
|
154
164
|
{
|
@@ -158,19 +168,19 @@
|
|
158
168
|
"start": -1,
|
159
169
|
"end": -1,
|
160
170
|
"groups": [
|
161
|
-
"<%= config[:environment_name] %>-
|
162
|
-
"<%= config[:environment_name] %>-
|
163
|
-
"<%= config[:environment_name] %>-
|
164
|
-
"<%= config[:environment_name] %>-
|
165
|
-
"<%= config[:environment_name] %>-
|
171
|
+
"<%= config[:environment_name] %>-ocp-master",
|
172
|
+
"<%= config[:environment_name] %>-ocp-node",
|
173
|
+
"<%= config[:environment_name] %>-ocp-nfs",
|
174
|
+
"<%= config[:environment_name] %>-ocp-lb",
|
175
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
166
176
|
]
|
167
177
|
}
|
168
178
|
]
|
169
179
|
}
|
170
180
|
},
|
171
181
|
"load_balancers": {
|
172
|
-
"
|
173
|
-
"security_groups": ["<%= config[:environment_name] %>-
|
182
|
+
"ocp-lb": {
|
183
|
+
"security_groups": ["<%= config[:environment_name] %>-ocp-lb"],
|
174
184
|
"subnets": ["1a", "1b", "1c"],
|
175
185
|
"scheme": "internet-facing",
|
176
186
|
"listeners": [
|
@@ -189,7 +199,7 @@
|
|
189
199
|
"instance_type": "m3.large",
|
190
200
|
"security_groups": [
|
191
201
|
"ops-admin",
|
192
|
-
"<%= config[:environment_name] %>-
|
202
|
+
"<%= config[:environment_name] %>-ocp-master"
|
193
203
|
]
|
194
204
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
195
205
|
,"private_ip_address": "",
|
@@ -212,7 +222,7 @@
|
|
212
222
|
"instance_type": "m3.large",
|
213
223
|
"security_groups": [
|
214
224
|
"ops-admin",
|
215
|
-
"<%= config[:environment_name] %>-
|
225
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
216
226
|
]
|
217
227
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
218
228
|
,"private_ip_address": "",
|
@@ -222,7 +232,7 @@
|
|
222
232
|
"run_list": [
|
223
233
|
"role[ose_node_server]"
|
224
234
|
],
|
225
|
-
"load_balancers": ["
|
235
|
+
"load_balancers": ["ocp-lb"],
|
226
236
|
"chef_attributes":{
|
227
237
|
"openshift":{
|
228
238
|
"labels":{
|
@@ -237,7 +247,7 @@
|
|
237
247
|
"instance_type": "m3.large",
|
238
248
|
"security_groups": [
|
239
249
|
"ops-admin",
|
240
|
-
"<%= config[:environment_name] %>-
|
250
|
+
"<%= config[:environment_name] %>-ocp-infra"
|
241
251
|
]
|
242
252
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
243
253
|
,"private_ip_address": "",
|
@@ -247,7 +257,7 @@
|
|
247
257
|
"run_list": [
|
248
258
|
"role[ose_node_server]"
|
249
259
|
],
|
250
|
-
"load_balancers": ["
|
260
|
+
"load_balancers": ["ocp-lb"],
|
251
261
|
"chef_attributes":{
|
252
262
|
"openshift":{
|
253
263
|
"labels":{
|
@@ -262,7 +272,7 @@
|
|
262
272
|
"instance_type": "m3.xlarge",
|
263
273
|
"security_groups": [
|
264
274
|
"ops-admin",
|
265
|
-
"<%= config[:environment_name] %>-
|
275
|
+
"<%= config[:environment_name] %>-ocp-node"
|
266
276
|
]
|
267
277
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
268
278
|
,"private_ip_address": "",
|
@@ -285,7 +295,7 @@
|
|
285
295
|
"instance_type": "m3.xlarge",
|
286
296
|
"security_groups": [
|
287
297
|
"ops-admin",
|
288
|
-
"<%= config[:environment_name] %>-
|
298
|
+
"<%= config[:environment_name] %>-ocp-node"
|
289
299
|
]
|
290
300
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
291
301
|
,"private_ip_address": "",
|
@@ -308,7 +318,7 @@
|
|
308
318
|
"instance_type": "m3.xlarge",
|
309
319
|
"security_groups": [
|
310
320
|
"ops-admin",
|
311
|
-
"<%= config[:environment_name] %>-
|
321
|
+
"<%= config[:environment_name] %>-ocp-node"
|
312
322
|
]
|
313
323
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
314
324
|
,"private_ip_address": "",
|
@@ -325,12 +335,14 @@
|
|
325
335
|
}
|
326
336
|
}
|
327
337
|
}
|
328
|
-
}
|
338
|
+
}
|
339
|
+
<%- unless config[:provider_config][:efs_enabled] -%>
|
340
|
+
,
|
329
341
|
"nfs1": {
|
330
342
|
"aws": {
|
331
343
|
"security_groups": [
|
332
344
|
"ops-admin",
|
333
|
-
"<%= config[:environment_name] %>-
|
345
|
+
"<%= config[:environment_name] %>-ocp-nfs"
|
334
346
|
]
|
335
347
|
<%- unless config[:provider_config][:cidr] == "none" -%>
|
336
348
|
,"private_ip_address": "",
|
@@ -348,5 +360,6 @@
|
|
348
360
|
}
|
349
361
|
}
|
350
362
|
}
|
363
|
+
<%- end -%>
|
351
364
|
}
|
352
365
|
}
|