corl 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23fcbd9522d74de8d9fabe3088878f6cb9dc3a6c
4
- data.tar.gz: 6c43e4e675d03eef1cc30d177ec08202cd3901fd
3
+ metadata.gz: 1181f057133b1e194133f258705368c735857e7d
4
+ data.tar.gz: 331b4db63e4a5c9c7511a28ce1a543f35f59c121
5
5
  SHA512:
6
- metadata.gz: 042608cad0db86ae1b155d543439fd0d1dd9d7a973430bee5a53fe059627a277968b49d9030c56b0613e7c4d6aa944c9cfdb0efd5a85602044de8a6113470c95
7
- data.tar.gz: 4842c6e679aae45c3fa6cb589d9f5d4d172220971c752bea454865928df71be8557115248b9805887110785299c91161bde4228b3cec2c99257b3691da6264e2
6
+ metadata.gz: 9f3b203645b9c5c05e8f744ecc6a1261a37f45d158b818827f3bc13cd58ced70f85e8c054a6d07f40f5c55eccc9137446373a12b17daef82580814b2b9bb7bc6
7
+ data.tar.gz: adabf9741d0e51b0481cf6891075eddf92b798486ffecb0a610dae53af38c62fc8f5f030a992f14d52a4394e54f96f72ffc157e8571acc0d7d6d00c8d5073e12
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.9
1
+ 0.5.10
data/corl.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: corl 0.5.9 ruby lib
5
+ # stub: corl 0.5.10 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "corl"
9
- s.version = "0.5.9"
9
+ s.version = "0.5.10"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -56,13 +56,11 @@ Gem::Specification.new do |s|
56
56
  "lib/CORL/builder/project.rb",
57
57
  "lib/CORL/configuration/file.rb",
58
58
  "lib/CORL/machine/AWS.rb",
59
- "lib/CORL/machine/docker.rb",
60
59
  "lib/CORL/machine/physical.rb",
61
60
  "lib/CORL/machine/rackspace.rb",
62
61
  "lib/CORL/machine/vagrant.rb",
63
62
  "lib/CORL/network/CORL.rb",
64
63
  "lib/CORL/node/AWS.rb",
65
- "lib/CORL/node/docker.rb",
66
64
  "lib/CORL/node/local.rb",
67
65
  "lib/CORL/node/rackspace.rb",
68
66
  "lib/CORL/node/vagrant.rb",
@@ -79,7 +77,6 @@ Gem::Specification.new do |s|
79
77
  "lib/core/mod/fog_aws_server.rb",
80
78
  "lib/core/mod/fog_rackspace_server.rb",
81
79
  "lib/core/mod/hiera_backend.rb",
82
- "lib/core/mod/vagrant.rb",
83
80
  "lib/core/plugin/agent.rb",
84
81
  "lib/core/plugin/builder.rb",
85
82
  "lib/core/plugin/cloud_action.rb",
@@ -95,7 +92,6 @@ Gem::Specification.new do |s|
95
92
  "lib/core/util/puppet/resource_group.rb",
96
93
  "lib/core/vagrant/action.rb",
97
94
  "lib/core/vagrant/actions/delete_cache.rb",
98
- "lib/core/vagrant/actions/include_overrides.rb",
99
95
  "lib/core/vagrant/actions/init_keys.rb",
100
96
  "lib/core/vagrant/actions/link_network.rb",
101
97
  "lib/core/vagrant/commands/launcher.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Webb
@@ -216,13 +216,11 @@ files:
216
216
  - lib/CORL/builder/project.rb
217
217
  - lib/CORL/configuration/file.rb
218
218
  - lib/CORL/machine/AWS.rb
219
- - lib/CORL/machine/docker.rb
220
219
  - lib/CORL/machine/physical.rb
221
220
  - lib/CORL/machine/rackspace.rb
222
221
  - lib/CORL/machine/vagrant.rb
223
222
  - lib/CORL/network/CORL.rb
224
223
  - lib/CORL/node/AWS.rb
225
- - lib/CORL/node/docker.rb
226
224
  - lib/CORL/node/local.rb
227
225
  - lib/CORL/node/rackspace.rb
228
226
  - lib/CORL/node/vagrant.rb
@@ -239,7 +237,6 @@ files:
239
237
  - lib/core/mod/fog_aws_server.rb
240
238
  - lib/core/mod/fog_rackspace_server.rb
241
239
  - lib/core/mod/hiera_backend.rb
242
- - lib/core/mod/vagrant.rb
243
240
  - lib/core/plugin/agent.rb
244
241
  - lib/core/plugin/builder.rb
245
242
  - lib/core/plugin/cloud_action.rb
@@ -255,7 +252,6 @@ files:
255
252
  - lib/core/util/puppet/resource_group.rb
256
253
  - lib/core/vagrant/action.rb
257
254
  - lib/core/vagrant/actions/delete_cache.rb
258
- - lib/core/vagrant/actions/include_overrides.rb
259
255
  - lib/core/vagrant/actions/init_keys.rb
260
256
  - lib/core/vagrant/actions/link_network.rb
261
257
  - lib/core/vagrant/commands/launcher.rb
@@ -1,327 +0,0 @@
1
-
2
- module CORL
3
- module Machine
4
- class Docker < Nucleon.plugin_class(:CORL, :machine)
5
-
6
- #include Mixin::Machine::SSH
7
-
8
- #---
9
-
10
- #@@lock = Mutex.new
11
-
12
- #-----------------------------------------------------------------------------
13
- # Machine plugin interface
14
-
15
- def normalize(reload)
16
- super
17
- #myself.plugin_name = node.plugin_name if node
18
- end
19
-
20
- #-----------------------------------------------------------------------------
21
- # Checks
22
-
23
- def created?
24
- server && state != :not_created
25
- end
26
-
27
- #---
28
-
29
- def running?
30
- server && state == :running
31
- end
32
-
33
- #-----------------------------------------------------------------------------
34
- # Property accessors / modifiers
35
-
36
- def set_command
37
- #@command = nil
38
-
39
- #begin
40
- # # Ensure we are running within Vagrant from the corl base command
41
- # require 'docker'
42
- #
43
- # logger.info("Setting up Vagrant for machine")
44
- # @command = CORL::Vagrant.command
45
- #
46
- #rescue LoadError
47
- #end
48
- end
49
- protected :set_command
50
-
51
- #---
52
-
53
- def command
54
- #set_command unless @command
55
- #@command
56
- end
57
-
58
- #---
59
-
60
- def env
61
- #return command.env if command
62
- #nil
63
- end
64
-
65
- #---
66
-
67
- def server=id
68
- #@server = nil
69
- #
70
- #if id.is_a?(String)
71
- # @server = new_machine(id)
72
- #elsif ! id.nil?
73
- # @server = id
74
- #end
75
- end
76
-
77
- def server
78
- #command
79
- #load unless @server
80
- #@server
81
- end
82
-
83
- #---
84
-
85
- def state
86
- #return server.state.id if server
87
- #:not_loaded
88
- end
89
-
90
- #---
91
-
92
- def machine_types
93
- #[ :virtualbox, :vmware_fusion, :hyperv ]
94
- end
95
-
96
- #-----------------------------------------------------------------------------
97
- # Management
98
-
99
- def load
100
- super do
101
- # myself.server = plugin_name if command && plugin_name
102
- # ! plugin_name && @server.nil? ? false : true
103
- end
104
- end
105
-
106
- #---
107
-
108
- def create(options = {})
109
- super do |config|
110
- # start_machine(config)
111
- end
112
- end
113
-
114
- #---
115
-
116
- def download(remote_path, local_path, options = {}, &code)
117
- super do |config, success|
118
- #ssh_download(remote_path, local_path, config, &code)
119
- end
120
- end
121
-
122
- #---
123
-
124
- def upload(local_path, remote_path, options = {}, &code)
125
- super do |config, success|
126
- #ssh_upload(local_path, remote_path, config, &code)
127
- end
128
- end
129
-
130
- #---
131
-
132
- def exec(commands, options = {}, &code)
133
- super do |config|
134
- #ssh_exec(commands, config, &code)
135
- end
136
- end
137
-
138
- #---
139
-
140
- def terminal(user, options = {})
141
- super do |config|
142
- #ssh_terminal(user, config)
143
- end
144
- end
145
-
146
- #---
147
-
148
- def reload(options = {})
149
- super do |config|
150
- #success = run(:reload, config)
151
- #success = init_ssh_session(true, config.get(:tries, 12), config.get(:sleep_time, 5)) if success
152
- end
153
- end
154
-
155
- #---
156
-
157
- def create_image(options = {})
158
- super do |config|
159
- #stop = config.delete(:stop, false)
160
- #
161
- ## TODO: Decide how to handle versions??
162
- ## Timestamps stink since these things are huge (>600MB)
163
- #box_name = sprintf("%s", node.id).gsub(/\s+/, '-')
164
- #box_path = File.join(node.network.directory, 'boxes', "#{box_name}.box")
165
- #box_url = "file://#{box_path}"
166
- #FileUtils.mkdir_p(File.dirname(box_path))
167
- #FileUtils.rm_f(box_path)
168
- #
169
- #begin
170
- # close_ssh_session
171
- # success = run(:package, config.defaults({ 'package.output' => box_path }), false)
172
- #
173
- # node.set_cache_setting(:box, box_name)
174
- # node.set_cache_setting(:box_url, box_url)
175
- #
176
- # if success
177
- # env.action_runner.run(::Vagrant::Action.action_box_add, {
178
- # :box_name => box_name,
179
- # :box_url => box_url,
180
- # :box_clean => false,
181
- # :box_force => true,
182
- # :ui => ::Vagrant::UI::Prefixed.new(env.ui, "box")
183
- # })
184
- # load
185
- # end
186
- #
187
- #rescue => error
188
- # error(error.message, { :i18n => false })
189
- # success = false
190
- #end
191
- #
192
- #success = run(:up, config) if success && ! stop
193
- #success
194
- end
195
- end
196
-
197
- #---
198
-
199
- def stop(options = {})
200
- super do |config|
201
- #create_image(config.import({ :stop => true }))
202
- end
203
- end
204
-
205
- #---
206
-
207
- def start(options = {})
208
- super do |config|
209
- #start_machine(config)
210
- end
211
- end
212
-
213
- #---
214
-
215
- def destroy(options = {})
216
- super do |config|
217
- ## We should handle prompting internally to keep it consistent
218
- #success = run(:destroy, config.defaults({ :force_confirm_destroy => true }))
219
- #
220
- #if success
221
- # box_name = sprintf("%s", node.id).gsub(/\s+/, '-')
222
- # found = false
223
- #
224
- # # TODO: Figure out box versions.
225
- #
226
- # env.boxes.all.each do |info|
227
- # registered_box_name = info[0]
228
- # registered_box_version = info[1]
229
- # registered_box_provider = info[2]
230
- #
231
- # if box_name == registered_box_name
232
- # found = true
233
- # break
234
- # end
235
- # end
236
- #
237
- # if found
238
- # env.action_runner.run(::Vagrant::Action.action_box_remove, {
239
- # :box_name => box_name,
240
- # :box_provider => node.machine_type
241
- # })
242
- #
243
- # box_name = sprintf("%s", node.id).gsub(/\s+/, '-')
244
- # box_path = File.join(node.network.directory, 'boxes', "#{box_name}.box")
245
- # Util::Disk.delete(box_path)
246
- # end
247
- #end
248
- #close_ssh_session if success
249
- #success
250
- end
251
- end
252
-
253
- #-----------------------------------------------------------------------------
254
- # Utilities
255
-
256
- def refresh_config
257
- if env
258
- #@@lock.synchronize do
259
- # begin
260
- # CORL::Vagrant::Config.network = node.network
261
- # env.vagrantfile.reload
262
- # ensure
263
- # CORL::Vagrant::Config.network = nil
264
- # end
265
- #end
266
- end
267
- end
268
- protected :refresh_config
269
-
270
- #---
271
-
272
- def new_machine(id)
273
- #server = nil
274
- #if command && ! id.empty?
275
- # refresh_config
276
- # if env.vagrantfile.machine_names.include?(id.to_sym)
277
- # server = command.vm_machine(id.to_sym, node.machine_type, true)
278
- # end
279
- #end
280
- #server
281
- end
282
- protected :new_machine
283
-
284
- #---
285
-
286
- def start_machine(options)
287
- #success = false
288
- #
289
- #if server
290
- # load
291
- # success = run(:up, options)
292
- #
293
- # # Make sure provisioner changes (key changes) are accounted for
294
- # # TODO: Is there a better way?
295
- # load if success
296
- #end
297
- #success
298
- end
299
- protected :start_machine
300
-
301
- #---
302
-
303
- def run(action, options = {}, symbolize_keys = true)
304
- #config = Config.ensure(options)
305
- #
306
- #if server
307
- # logger.debug("Running Vagrant action #{action} on machine #{node.id}")
308
- #
309
- # success = true
310
- # begin
311
- # params = config.export
312
- # params = string_map(params) unless symbolize_keys
313
- #
314
- # server.send(:action, action.to_sym, params)
315
- #
316
- # rescue => error
317
- # error(error.message, { :i18n => false })
318
- # error(Util::Data.to_yaml(error.backtrace), { :i18n => false })
319
- # success = false
320
- # end
321
- #end
322
- #success
323
- end
324
- protected :run
325
- end
326
- end
327
- end
@@ -1,269 +0,0 @@
1
-
2
- module CORL
3
- module Node
4
- class Docker < Nucleon.plugin_class(:CORL, :node)
5
-
6
- #-----------------------------------------------------------------------------
7
- # Node plugin interface
8
-
9
- def normalize(reload)
10
- super
11
-
12
- #unless reload
13
- # machine_provider = :vagrant
14
- # machine_provider = yield if block_given?
15
- #
16
- # myself.machine = create_machine(:machine, machine_provider, machine_config)
17
- #end
18
- #
19
- #network.ignore([ '.vagrant', 'boxes' ])
20
- #init_shares
21
- end
22
-
23
- #-----------------------------------------------------------------------------
24
- # Checks
25
-
26
- #-----------------------------------------------------------------------------
27
- # Property accessors / modifiers
28
-
29
- def state(reset = false)
30
- #machine.state
31
- end
32
-
33
- #---
34
-
35
- def vm=vm
36
- #myself[:vm] = vm
37
- end
38
-
39
- def vm
40
- #hash(myself[:vm])
41
- end
42
-
43
- #---
44
-
45
- def ssh=ssh
46
- #myself[:ssh] = ssh
47
- end
48
-
49
- def ssh
50
- #hash(myself[:ssh])
51
- end
52
-
53
- #---
54
-
55
- def shares=shares
56
- #myself[:shares] = shares
57
- #init_shares
58
- end
59
-
60
- def shares
61
- #hash(myself[:shares])
62
- end
63
-
64
- #---
65
-
66
- def build_time=time
67
- #set_cache_setting(:build, time)
68
- end
69
-
70
- def build_time
71
- #cache_setting(:build, nil)
72
- end
73
-
74
- #---
75
-
76
- def bootstrap_script=bootstrap
77
- #set_cache_setting(:bootstrap, bootstrap)
78
- end
79
-
80
- def bootstrap_script
81
- #cache_setting(:bootstrap, nil)
82
- end
83
-
84
- #-----------------------------------------------------------------------------
85
- # Settings groups
86
-
87
- def machine_config
88
- super do |config|
89
- #config[:vm] = vm
90
- #config[:shares] = shares
91
-
92
- yield(config) if block_given?
93
- end
94
- end
95
-
96
- #---
97
-
98
- def exec_options(name, options = {})
99
- extended_config(name, options).export
100
- end
101
-
102
- #-----------------------------------------------------------------------------
103
- # Node operations
104
-
105
- def build(options = {})
106
- super(Config.ensure(options).import({ :save => false }))
107
- end
108
-
109
- #---
110
-
111
- def create(options = {})
112
- super do |op, config|
113
- if op == :config
114
- config.import(exec_options(:create))
115
- #config[:provision_enabled] = false
116
- end
117
- end
118
- end
119
-
120
- #---
121
-
122
- def download(remote_path, local_path, options = {})
123
- super do |op, config|
124
- if op == :config
125
- config.import(exec_options(:download))
126
- end
127
- end
128
- end
129
-
130
- #---
131
-
132
- def upload(local_path, remote_path, options = {})
133
- super do |op, config|
134
- if op == :config
135
- config.import(exec_options(:upload))
136
- end
137
- end
138
- end
139
-
140
- #---
141
-
142
- def exec(options = {})
143
- super do |op, config|
144
- if op == :config
145
- config.import(exec_options(:exec))
146
- end
147
- end
148
- end
149
-
150
- #---
151
-
152
- def save(options = {})
153
- super do
154
- id(true)
155
- delete_setting(:machine_type)
156
- end
157
- end
158
-
159
- #---
160
-
161
- def start(options = {})
162
- super do |op, config|
163
- if op == :config
164
- config.import(exec_options(:start))
165
- #config[:provision_enabled] = false
166
- end
167
- end
168
- end
169
-
170
- #---
171
-
172
- def reload(options = {})
173
- super do |op, config|
174
- if op == :config
175
- config.import(exec_options(:reload))
176
- #config[:provision_enabled] = false
177
- end
178
- end
179
- end
180
-
181
- #---
182
-
183
- def create_image(options = {})
184
- super do |op, config|
185
- if op == :config
186
- config.import(exec_options(:image))
187
- end
188
- end
189
- end
190
-
191
- #---
192
-
193
- def stop(options = {})
194
- super do |op, config|
195
- if op == :config
196
- config.import(exec_options(:stop))
197
- elsif op == :finalize
198
- true
199
- end
200
- end
201
- end
202
-
203
- #---
204
-
205
- def destroy(options = {})
206
- super do |op, config|
207
- if op == :config
208
- config.import(exec_options(:destroy))
209
- end
210
- end
211
- end
212
-
213
- #-----------------------------------------------------------------------------
214
- # Utilities
215
-
216
- def init_shares
217
- #shares.each do |name, info|
218
- # local_dir = info[:local]
219
- # network.ignore(local_dir) unless info[:type].to_s =~ /^rsync-?.*/
220
- #end
221
- end
222
-
223
- #---
224
-
225
- def filter_output(type, data)
226
- data = super
227
-
228
- #if type == :error
229
- # if data.include?('stdin: is not a tty') || data.include?('unable to re-open stdin')
230
- # data = ''
231
- # end
232
- #end
233
- data
234
- end
235
-
236
- #-----------------------------------------------------------------------------
237
- # Machine type utilities
238
-
239
- def machine_type_id(machine_type)
240
- #machine_type
241
- end
242
-
243
- #---
244
-
245
- def render_machine_type(machine_type)
246
- #machine_type.to_s
247
- end
248
-
249
- #-----------------------------------------------------------------------------
250
- # Image utilities
251
-
252
- def image_id(image)
253
- #image.id
254
- end
255
-
256
- #---
257
-
258
- def render_image(image)
259
- #''
260
- end
261
-
262
- #---
263
-
264
- def image_search_text(image)
265
- #image.to_s
266
- end
267
- end
268
- end
269
- end
@@ -1,30 +0,0 @@
1
-
2
- module VagrantPlugins
3
- module CommunicatorSSH
4
- class Communicator
5
- # Override Vagrant key insertion (we handle generated keys internally)
6
- def ready?
7
- @logger.debug("Checking whether SSH is ready...")
8
-
9
- # Attempt to connect. This will raise an exception if it fails.
10
- begin
11
- connect
12
- @logger.info("SSH is ready!")
13
- rescue Vagrant::Errors::VagrantError => e
14
- # We catch a `VagrantError` which would signal that something went
15
- # wrong expectedly in the `connect`, which means we didn't connect.
16
- @logger.info("SSH not up: #{e.inspect}")
17
- return false
18
- end
19
-
20
- # Verify the shell is valid
21
- if execute("", error_check: false) != 0
22
- raise Vagrant::Errors::SSHInvalidShell
23
- end
24
-
25
- # If we reached this point then we successfully connected
26
- true
27
- end
28
- end
29
- end
30
- end
@@ -1,17 +0,0 @@
1
-
2
- module VagrantPlugins
3
- module CORL
4
- module Action
5
- class IncludeOverrides < BaseAction
6
-
7
- def call(env)
8
- super do
9
- # Ignore Vagrant key generation (we handle our own keys)
10
- #load File.join(File.dirname(__FILE__), '..', '..', 'mod', 'vagrant.rb')
11
- @app.call env
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end