corl 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +3 -21
- data/VERSION +1 -1
- data/bootstrap/os/ubuntu/05_ruby.sh +24 -18
- data/bootstrap/os/ubuntu/06_puppet.sh +58 -0
- data/bootstrap/os/ubuntu/10_corl.sh +1 -25
- data/corl.gemspec +5 -3
- data/lib/CORL/builder/identity.rb +14 -14
- data/lib/CORL/builder/package.rb +18 -18
- data/lib/CORL/builder/project.rb +37 -0
- data/lib/CORL/node/vagrant.rb +76 -76
- data/lib/CORL/provisioner/puppetnode.rb +98 -92
- data/lib/core/build.rb +34 -36
- data/lib/core/plugin/network.rb +2 -2
- data/lib/core/plugin/node.rb +38 -16
- data/lib/core/plugin/provisioner.rb +91 -91
- data/lib/core/util/puppet.rb +107 -107
- data/lib/core/vagrant/provisioner/config.rb +32 -19
- data/lib/core/vagrant/provisioner/provisioner.rb +17 -11
- data/lib/nucleon/action/node/bootstrap.rb +2 -0
- data/lib/nucleon/action/node/build.rb +13 -12
- data/lib/nucleon/action/node/exec.rb +21 -19
- data/lib/nucleon/action/node/provision.rb +27 -23
- data/lib/nucleon/action/node/seed.rb +2 -0
- data/locales/en.yml +27 -1
- metadata +4 -2
data/lib/CORL/node/vagrant.rb
CHANGED
@@ -2,123 +2,123 @@
|
|
2
2
|
module CORL
|
3
3
|
module Node
|
4
4
|
class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
5
|
-
|
5
|
+
|
6
6
|
#-----------------------------------------------------------------------------
|
7
7
|
# Node plugin interface
|
8
|
-
|
8
|
+
|
9
9
|
def normalize(reload)
|
10
10
|
super
|
11
|
-
|
11
|
+
|
12
12
|
unless reload
|
13
13
|
machine_provider = :vagrant
|
14
14
|
machine_provider = yield if block_given?
|
15
|
-
|
15
|
+
|
16
16
|
myself.machine = create_machine(:machine, machine_provider, machine_config)
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
network.ignore([ '.vagrant', 'boxes' ])
|
20
20
|
init_shares
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
#-----------------------------------------------------------------------------
|
24
24
|
# Checks
|
25
|
-
|
25
|
+
|
26
26
|
#-----------------------------------------------------------------------------
|
27
27
|
# Property accessors / modifiers
|
28
|
-
|
28
|
+
|
29
29
|
def state(reset = false)
|
30
30
|
machine.state
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
#---
|
34
|
-
|
34
|
+
|
35
35
|
def vm=vm
|
36
36
|
myself[:vm] = vm
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def vm
|
40
40
|
hash(myself[:vm])
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
#---
|
44
|
-
|
44
|
+
|
45
45
|
def ssh=ssh
|
46
46
|
myself[:ssh] = ssh
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def ssh
|
50
50
|
hash(myself[:ssh])
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
#---
|
54
|
-
|
54
|
+
|
55
55
|
def shares=shares
|
56
56
|
myself[:shares] = shares
|
57
57
|
init_shares
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def shares
|
61
61
|
hash(myself[:shares])
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
#---
|
65
|
-
|
65
|
+
|
66
66
|
def build_time=time
|
67
67
|
set_cache_setting(:build, time)
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def build_time
|
71
71
|
cache_setting(:build, nil)
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
#---
|
75
|
-
|
75
|
+
|
76
76
|
def bootstrap_script=bootstrap
|
77
77
|
set_cache_setting(:bootstrap, bootstrap)
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
def bootstrap_script
|
81
|
-
cache_setting(:bootstrap, nil)
|
81
|
+
cache_setting(:bootstrap, nil)
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
#-----------------------------------------------------------------------------
|
85
85
|
# Settings groups
|
86
|
-
|
86
|
+
|
87
87
|
def machine_config
|
88
|
-
super do |config|
|
88
|
+
super do |config|
|
89
89
|
config[:vm] = vm
|
90
90
|
config[:shares] = shares
|
91
|
-
|
91
|
+
|
92
92
|
yield(config) if block_given?
|
93
93
|
end
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
#---
|
97
|
-
|
97
|
+
|
98
98
|
def exec_options(name, options = {})
|
99
99
|
extended_config(name, options).export
|
100
100
|
end
|
101
|
-
|
101
|
+
|
102
102
|
#-----------------------------------------------------------------------------
|
103
103
|
# Node operations
|
104
|
-
|
104
|
+
|
105
105
|
def build(options = {})
|
106
|
-
super(Config.ensure(options).import({ :save => false }))
|
106
|
+
super(Config.ensure(options).import({ :save => false }))
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
#---
|
110
|
-
|
110
|
+
|
111
111
|
def create(options = {})
|
112
112
|
super do |op, config|
|
113
113
|
if op == :config
|
114
114
|
config.import(exec_options(:create))
|
115
115
|
config[:provision_enabled] = false
|
116
|
-
end
|
116
|
+
end
|
117
117
|
end
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
#---
|
121
|
-
|
121
|
+
|
122
122
|
def download(remote_path, local_path, options = {})
|
123
123
|
super do |op, config|
|
124
124
|
if op == :config
|
@@ -126,9 +126,9 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
129
|
-
|
129
|
+
|
130
130
|
#---
|
131
|
-
|
131
|
+
|
132
132
|
def upload(local_path, remote_path, options = {})
|
133
133
|
super do |op, config|
|
134
134
|
if op == :config
|
@@ -136,9 +136,9 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
end
|
139
|
-
|
139
|
+
|
140
140
|
#---
|
141
|
-
|
141
|
+
|
142
142
|
def exec(options = {})
|
143
143
|
super do |op, config|
|
144
144
|
if op == :config
|
@@ -146,18 +146,18 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
end
|
149
|
-
|
149
|
+
|
150
150
|
#---
|
151
|
-
|
151
|
+
|
152
152
|
def save(options = {})
|
153
153
|
super do
|
154
154
|
id(true)
|
155
|
-
delete_setting(:machine_type)
|
156
|
-
end
|
155
|
+
delete_setting(:machine_type)
|
156
|
+
end
|
157
157
|
end
|
158
|
-
|
158
|
+
|
159
159
|
#---
|
160
|
-
|
160
|
+
|
161
161
|
def start(options = {})
|
162
162
|
super do |op, config|
|
163
163
|
if op == :config
|
@@ -166,9 +166,9 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
end
|
169
|
-
|
169
|
+
|
170
170
|
#---
|
171
|
-
|
171
|
+
|
172
172
|
def reload(options = {})
|
173
173
|
super do |op, config|
|
174
174
|
if op == :config
|
@@ -177,9 +177,9 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
end
|
180
|
-
|
180
|
+
|
181
181
|
#---
|
182
|
-
|
182
|
+
|
183
183
|
def create_image(options = {})
|
184
184
|
super do |op, config|
|
185
185
|
if op == :config
|
@@ -187,9 +187,9 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
187
187
|
end
|
188
188
|
end
|
189
189
|
end
|
190
|
-
|
190
|
+
|
191
191
|
#---
|
192
|
-
|
192
|
+
|
193
193
|
def stop(options = {})
|
194
194
|
super do |op, config|
|
195
195
|
if op == :config
|
@@ -199,71 +199,71 @@ class Vagrant < Nucleon.plugin_class(:CORL, :node)
|
|
199
199
|
end
|
200
200
|
end
|
201
201
|
end
|
202
|
-
|
202
|
+
|
203
203
|
#---
|
204
204
|
|
205
|
-
def destroy(options = {})
|
205
|
+
def destroy(options = {})
|
206
206
|
super do |op, config|
|
207
207
|
if op == :config
|
208
208
|
config.import(exec_options(:destroy))
|
209
209
|
end
|
210
210
|
end
|
211
211
|
end
|
212
|
-
|
212
|
+
|
213
213
|
#-----------------------------------------------------------------------------
|
214
214
|
# Utilities
|
215
|
-
|
215
|
+
|
216
216
|
def init_shares
|
217
217
|
shares.each do |name, info|
|
218
218
|
local_dir = info[:local]
|
219
|
-
network.ignore(local_dir)
|
219
|
+
network.ignore(local_dir) unless info[:type].to_s =~ /^rsync-?.*/
|
220
220
|
end
|
221
221
|
end
|
222
|
-
|
222
|
+
|
223
223
|
#---
|
224
|
-
|
224
|
+
|
225
225
|
def filter_output(type, data)
|
226
226
|
data = super
|
227
|
-
|
227
|
+
|
228
228
|
if type == :error
|
229
229
|
if data.include?('stdin: is not a tty') || data.include?('unable to re-open stdin')
|
230
|
-
data = ''
|
230
|
+
data = ''
|
231
231
|
end
|
232
232
|
end
|
233
|
-
data
|
233
|
+
data
|
234
234
|
end
|
235
|
-
|
235
|
+
|
236
236
|
#-----------------------------------------------------------------------------
|
237
237
|
# Machine type utilities
|
238
|
-
|
238
|
+
|
239
239
|
def machine_type_id(machine_type)
|
240
240
|
machine_type
|
241
241
|
end
|
242
|
-
|
242
|
+
|
243
243
|
#---
|
244
|
-
|
244
|
+
|
245
245
|
def render_machine_type(machine_type)
|
246
246
|
machine_type.to_s
|
247
247
|
end
|
248
|
-
|
248
|
+
|
249
249
|
#-----------------------------------------------------------------------------
|
250
250
|
# Image utilities
|
251
|
-
|
251
|
+
|
252
252
|
def image_id(image)
|
253
253
|
image.id
|
254
254
|
end
|
255
|
-
|
255
|
+
|
256
256
|
#---
|
257
|
-
|
257
|
+
|
258
258
|
def render_image(image)
|
259
|
-
''
|
259
|
+
''
|
260
260
|
end
|
261
|
-
|
261
|
+
|
262
262
|
#---
|
263
|
-
|
263
|
+
|
264
264
|
def image_search_text(image)
|
265
265
|
image.to_s
|
266
|
-
end
|
266
|
+
end
|
267
267
|
end
|
268
268
|
end
|
269
269
|
end
|