corl 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/Gemfile.lock +5 -10
- data/VERSION +1 -1
- data/bootstrap/bootstrap.sh +1 -4
- data/bootstrap/os/ubuntu/05_ruby.sh +9 -3
- data/bootstrap/os/ubuntu/10_corl.sh +26 -2
- data/corl.gemspec +7 -10
- data/lib/CORL/machine/AWS.rb +38 -38
- data/lib/CORL/machine/rackspace.rb +2 -3
- data/lib/CORL/node/AWS.rb +36 -36
- data/lib/CORL/node/rackspace.rb +30 -30
- data/lib/core/mod/fog_rackspace_server.rb +29 -0
- data/lib/core/plugin/fog_machine.rb +66 -65
- data/lib/core/plugin/fog_node.rb +56 -56
- data/lib/core/plugin/node.rb +1 -1
- data/lib/corl.rb +14 -14
- data/lib/nucleon/action/node/bootstrap.rb +1 -1
- metadata +20 -30
- data/bootstrap/os/ubuntu/06_puppet.sh +0 -51
data/lib/core/plugin/fog_node.rb
CHANGED
@@ -5,84 +5,84 @@ nucleon_require(File.dirname(__FILE__), :node)
|
|
5
5
|
|
6
6
|
module CORL
|
7
7
|
module Node
|
8
|
-
class
|
9
|
-
|
8
|
+
class FogBase < Nucleon.plugin_class(:CORL, :node)
|
9
|
+
|
10
10
|
#-----------------------------------------------------------------------------
|
11
11
|
# Node plugin interface
|
12
|
-
|
12
|
+
|
13
13
|
def normalize(reload)
|
14
14
|
super
|
15
|
-
|
15
|
+
|
16
16
|
@region_info = Config.new({}, {}, true, false) unless reload
|
17
|
-
|
18
|
-
myself.region = region
|
19
|
-
|
20
|
-
unless reload
|
17
|
+
|
18
|
+
myself.region = region
|
19
|
+
|
20
|
+
unless reload
|
21
21
|
machine_provider = :fog
|
22
22
|
machine_provider = yield if block_given?
|
23
|
-
|
23
|
+
|
24
24
|
myself.machine = create_machine(:machine, machine_provider, machine_config)
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
#-----------------------------------------------------------------------------
|
29
29
|
# Checks
|
30
|
-
|
30
|
+
|
31
31
|
#-----------------------------------------------------------------------------
|
32
32
|
# Property accessors / modifiers
|
33
|
-
|
33
|
+
|
34
34
|
def api_user=api_user
|
35
35
|
myself[:api_user] = api_user
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def api_user
|
39
39
|
myself[:api_user]
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
#---
|
43
|
-
|
43
|
+
|
44
44
|
def api_key=api_key
|
45
45
|
myself[:api_key] = api_key
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
def api_key
|
49
49
|
myself[:api_key]
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
#---
|
53
|
-
|
53
|
+
|
54
54
|
def auth_url=auth_url
|
55
55
|
myself[:auth_url] = auth_url
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def auth_url
|
59
59
|
myself[:auth_url]
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
#---
|
63
|
-
|
63
|
+
|
64
64
|
def connection_options=options
|
65
65
|
myself[:connection_options] = options
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
def connection_options
|
69
69
|
myself[:connection_options]
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
#---
|
73
|
-
|
73
|
+
|
74
74
|
def region_info
|
75
|
-
@region_info
|
75
|
+
@region_info
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
def regions
|
79
79
|
@region_info.keys
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
def region=region
|
83
83
|
myself[:region] = region
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
def region
|
87
87
|
if region = myself[:region]
|
88
88
|
region
|
@@ -92,44 +92,44 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
92
92
|
first_region
|
93
93
|
end
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
#-----------------------------------------------------------------------------
|
97
97
|
# Settings groups
|
98
|
-
|
98
|
+
|
99
99
|
def machine_config
|
100
|
-
super do |config|
|
100
|
+
super do |config|
|
101
101
|
config[:connection_options] = connection_options if connection_options
|
102
102
|
yield(config) if block_given?
|
103
103
|
end
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
#---
|
107
|
-
|
107
|
+
|
108
108
|
def key_config
|
109
109
|
{ :private_key_path => private_key, :public_key_path => public_key }
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
#---
|
113
|
-
|
113
|
+
|
114
114
|
def exec_options(name, options = {})
|
115
115
|
extended_config(name, options).export
|
116
116
|
end
|
117
|
-
|
117
|
+
|
118
118
|
#-----------------------------------------------------------------------------
|
119
119
|
# Node operations
|
120
|
-
|
120
|
+
|
121
121
|
def create(options = {})
|
122
122
|
super do |op, config|
|
123
123
|
if op == :config
|
124
124
|
config.import(exec_options(:create))
|
125
125
|
config.defaults(key_config)
|
126
126
|
end
|
127
|
-
yield(op, config) if block_given?
|
127
|
+
yield(op, config) if block_given?
|
128
128
|
end
|
129
129
|
end
|
130
|
-
|
130
|
+
|
131
131
|
#---
|
132
|
-
|
132
|
+
|
133
133
|
def download(remote_path, local_path, options = {})
|
134
134
|
super do |op, config|
|
135
135
|
if op == :config
|
@@ -138,9 +138,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
138
138
|
yield(op, config) if block_given?
|
139
139
|
end
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
#---
|
143
|
-
|
143
|
+
|
144
144
|
def upload(local_path, remote_path, options = {})
|
145
145
|
super do |op, config|
|
146
146
|
if op == :config
|
@@ -149,9 +149,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
149
149
|
yield(op, config) if block_given?
|
150
150
|
end
|
151
151
|
end
|
152
|
-
|
152
|
+
|
153
153
|
#---
|
154
|
-
|
154
|
+
|
155
155
|
def exec(options = {})
|
156
156
|
super do |op, config|
|
157
157
|
if op == :config
|
@@ -160,9 +160,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
160
160
|
yield(op, config) if block_given?
|
161
161
|
end
|
162
162
|
end
|
163
|
-
|
163
|
+
|
164
164
|
#---
|
165
|
-
|
165
|
+
|
166
166
|
def start(options = {})
|
167
167
|
super do |op, config|
|
168
168
|
if op == :config
|
@@ -172,9 +172,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
172
172
|
yield(op, config) if block_given?
|
173
173
|
end
|
174
174
|
end
|
175
|
-
|
175
|
+
|
176
176
|
#---
|
177
|
-
|
177
|
+
|
178
178
|
def reload(options = {})
|
179
179
|
super do |op, config|
|
180
180
|
if op == :config
|
@@ -183,9 +183,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
183
183
|
yield(op, config) if block_given?
|
184
184
|
end
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
187
|
#---
|
188
|
-
|
188
|
+
|
189
189
|
def create_image(options = {})
|
190
190
|
super do |op, config|
|
191
191
|
if op == :config
|
@@ -194,9 +194,9 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
194
194
|
yield(op, config) if block_given?
|
195
195
|
end
|
196
196
|
end
|
197
|
-
|
197
|
+
|
198
198
|
#---
|
199
|
-
|
199
|
+
|
200
200
|
def stop(options = {})
|
201
201
|
super do |op, config|
|
202
202
|
if op == :config
|
@@ -205,10 +205,10 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
205
205
|
yield(op, config) if block_given?
|
206
206
|
end
|
207
207
|
end
|
208
|
-
|
208
|
+
|
209
209
|
#---
|
210
210
|
|
211
|
-
def destroy(options = {})
|
211
|
+
def destroy(options = {})
|
212
212
|
super do |op, config|
|
213
213
|
if op == :config
|
214
214
|
config.import(exec_options(:destroy))
|
@@ -216,10 +216,10 @@ class Fog < Nucleon.plugin_class(:CORL, :node)
|
|
216
216
|
yield(op, config) if block_given?
|
217
217
|
end
|
218
218
|
end
|
219
|
-
|
219
|
+
|
220
220
|
#-----------------------------------------------------------------------------
|
221
221
|
# Utilities
|
222
|
-
|
222
|
+
|
223
223
|
def filter_output(type, data)
|
224
224
|
super
|
225
225
|
end
|
data/lib/core/plugin/node.rb
CHANGED
@@ -986,7 +986,7 @@ class Node < Nucleon.plugin_class(:nucleon, :base)
|
|
986
986
|
user_home = config[:home]
|
987
987
|
auth_files = config.get_array(:auth_files)
|
988
988
|
|
989
|
-
reboot = config.get(:reboot,
|
989
|
+
reboot = config.get(:reboot, true)
|
990
990
|
dev_build = config.get(:dev_build, false)
|
991
991
|
|
992
992
|
codes :local_path_not_found,
|
data/lib/corl.rb
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
#
|
5
5
|
# built on Nucleon (github.com/coralnexus/nucleon)
|
6
6
|
#
|
7
|
-
# A framework that provides a simple foundation for growing organically in
|
7
|
+
# A framework that provides a simple foundation for growing organically in
|
8
8
|
# the cloud.
|
9
9
|
#
|
10
10
|
# Author:: Adrian Webb (mailto:adrian.webb@coralnexus.com)
|
11
11
|
# License:: GPLv3
|
12
12
|
|
13
13
|
#-------------------------------------------------------------------------------
|
14
|
-
# Top level properties
|
14
|
+
# Top level properties
|
15
15
|
|
16
16
|
lib_dir = File.dirname(__FILE__)
|
17
17
|
core_dir = File.join(lib_dir, 'core')
|
@@ -23,7 +23,7 @@ macro_dir = File.join(mixin_dir, 'macro')
|
|
23
23
|
util_dir = File.join(core_dir, 'util')
|
24
24
|
mod_dir = File.join(core_dir, 'mod')
|
25
25
|
vagrant_dir = File.join(core_dir, 'vagrant')
|
26
|
-
|
26
|
+
|
27
27
|
#-------------------------------------------------------------------------------
|
28
28
|
# CORL requirements
|
29
29
|
|
@@ -69,7 +69,7 @@ end
|
|
69
69
|
#---
|
70
70
|
|
71
71
|
# Include CORL utilities
|
72
|
-
[ :puppet ].each do |name|
|
72
|
+
[ :puppet ].each do |name|
|
73
73
|
nucleon_require(util_dir, name)
|
74
74
|
end
|
75
75
|
|
@@ -82,14 +82,14 @@ nucleon_require(core_dir, :errors)
|
|
82
82
|
module Nucleon
|
83
83
|
class Config
|
84
84
|
extend Mixin::Lookup
|
85
|
-
include Mixin::Lookup
|
85
|
+
include Mixin::Lookup
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
#---
|
89
|
-
|
89
|
+
|
90
90
|
module Plugin
|
91
91
|
class Base
|
92
|
-
extend Mixin::Macro::NetworkSettings
|
92
|
+
extend Mixin::Macro::NetworkSettings
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -115,19 +115,19 @@ end
|
|
115
115
|
# CORL interface
|
116
116
|
|
117
117
|
module CORL
|
118
|
-
|
118
|
+
|
119
119
|
def self.VERSION
|
120
|
-
File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
|
120
|
+
File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
|
121
121
|
end
|
122
|
-
|
122
|
+
|
123
123
|
#-----------------------------------------------------------------------------
|
124
124
|
# CORL initialization
|
125
|
-
|
125
|
+
|
126
126
|
def self.lib_path
|
127
127
|
File.dirname(__FILE__)
|
128
128
|
end
|
129
|
-
|
130
|
-
#---
|
129
|
+
|
130
|
+
#---
|
131
131
|
|
132
132
|
reload(true, :corl) do |op, manager|
|
133
133
|
if op == :define
|
@@ -19,7 +19,7 @@ class Bootstrap < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
19
19
|
register_directory :bootstrap_path, File.join(CORL.lib_path, '..', 'bootstrap')
|
20
20
|
register_files :auth_files
|
21
21
|
|
22
|
-
register_bool :reboot,
|
22
|
+
register_bool :reboot, true
|
23
23
|
register_bool :dev_build, false
|
24
24
|
|
25
25
|
register_str :home_env_var, 'HOME'
|
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.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Webb
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-04 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nucleon
|
@@ -31,99 +31,89 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: "1.
|
34
|
+
version: "1.23"
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: fog-rackspace
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
-
requirements:
|
42
|
-
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version: "1.0"
|
45
|
-
type: :runtime
|
46
|
-
version_requirements: *id003
|
47
37
|
- !ruby/object:Gem::Dependency
|
48
38
|
name: unf
|
49
39
|
prerelease: false
|
50
|
-
requirement: &
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
41
|
requirements:
|
52
42
|
- - ~>
|
53
43
|
- !ruby/object:Gem::Version
|
54
44
|
version: "0.1"
|
55
45
|
type: :runtime
|
56
|
-
version_requirements: *
|
46
|
+
version_requirements: *id003
|
57
47
|
- !ruby/object:Gem::Dependency
|
58
48
|
name: facter
|
59
49
|
prerelease: false
|
60
|
-
requirement: &
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
61
51
|
requirements:
|
62
52
|
- - ~>
|
63
53
|
- !ruby/object:Gem::Version
|
64
54
|
version: "2.3"
|
65
55
|
type: :runtime
|
66
|
-
version_requirements: *
|
56
|
+
version_requirements: *id004
|
67
57
|
- !ruby/object:Gem::Dependency
|
68
58
|
name: hiera
|
69
59
|
prerelease: false
|
70
|
-
requirement: &
|
60
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
71
61
|
requirements:
|
72
62
|
- - ~>
|
73
63
|
- !ruby/object:Gem::Version
|
74
64
|
version: "1.3"
|
75
65
|
type: :runtime
|
76
|
-
version_requirements: *
|
66
|
+
version_requirements: *id005
|
77
67
|
- !ruby/object:Gem::Dependency
|
78
68
|
name: puppet
|
79
69
|
prerelease: false
|
80
|
-
requirement: &
|
70
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
81
71
|
requirements:
|
82
72
|
- - ~>
|
83
73
|
- !ruby/object:Gem::Version
|
84
74
|
version: "3.7"
|
85
75
|
type: :runtime
|
86
|
-
version_requirements: *
|
76
|
+
version_requirements: *id006
|
87
77
|
- !ruby/object:Gem::Dependency
|
88
78
|
name: bundler
|
89
79
|
prerelease: false
|
90
|
-
requirement: &
|
80
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
91
81
|
requirements:
|
92
82
|
- - ~>
|
93
83
|
- !ruby/object:Gem::Version
|
94
84
|
version: "1.7"
|
95
85
|
type: :development
|
96
|
-
version_requirements: *
|
86
|
+
version_requirements: *id007
|
97
87
|
- !ruby/object:Gem::Dependency
|
98
88
|
name: jeweler
|
99
89
|
prerelease: false
|
100
|
-
requirement: &
|
90
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
101
91
|
requirements:
|
102
92
|
- - ~>
|
103
93
|
- !ruby/object:Gem::Version
|
104
94
|
version: "2.0"
|
105
95
|
type: :development
|
106
|
-
version_requirements: *
|
96
|
+
version_requirements: *id008
|
107
97
|
- !ruby/object:Gem::Dependency
|
108
98
|
name: rspec
|
109
99
|
prerelease: false
|
110
|
-
requirement: &
|
100
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
111
101
|
requirements:
|
112
102
|
- - ~>
|
113
103
|
- !ruby/object:Gem::Version
|
114
104
|
version: "3.1"
|
115
105
|
type: :development
|
116
|
-
version_requirements: *
|
106
|
+
version_requirements: *id009
|
117
107
|
- !ruby/object:Gem::Dependency
|
118
108
|
name: rdoc
|
119
109
|
prerelease: false
|
120
|
-
requirement: &
|
110
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
121
111
|
requirements:
|
122
112
|
- - ~>
|
123
113
|
- !ruby/object:Gem::Version
|
124
114
|
version: "3.12"
|
125
115
|
type: :development
|
126
|
-
version_requirements: *
|
116
|
+
version_requirements: *id010
|
127
117
|
description: Framework that provides a simple foundation for growing organically in the cloud
|
128
118
|
email: adrian.webb@coralnexus.com
|
129
119
|
executables:
|
@@ -157,7 +147,6 @@ files:
|
|
157
147
|
- bootstrap/os/ubuntu/01_git.sh
|
158
148
|
- bootstrap/os/ubuntu/02_editor.sh
|
159
149
|
- bootstrap/os/ubuntu/05_ruby.sh
|
160
|
-
- bootstrap/os/ubuntu/06_puppet.sh
|
161
150
|
- bootstrap/os/ubuntu/09_nucleon.sh
|
162
151
|
- bootstrap/os/ubuntu/10_corl.sh
|
163
152
|
- corl.gemspec
|
@@ -184,6 +173,7 @@ files:
|
|
184
173
|
- lib/core/mixin/machine/ssh.rb
|
185
174
|
- lib/core/mixin/macro/network_settings.rb
|
186
175
|
- lib/core/mod/fog_aws_server.rb
|
176
|
+
- lib/core/mod/fog_rackspace_server.rb
|
187
177
|
- lib/core/mod/hiera_backend.rb
|
188
178
|
- lib/core/plugin/agent.rb
|
189
179
|
- lib/core/plugin/builder.rb
|