logical-construct 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module LogicalConstruct
|
|
12
12
|
setting :target_address, nil
|
13
13
|
setting :target_port, 51076
|
14
14
|
runtime_setting :target_url
|
15
|
-
setting :resolutions
|
15
|
+
setting :resolutions
|
16
16
|
runtime_setting :web_resolutions
|
17
17
|
|
18
18
|
def resolve_runtime_configuration
|
@@ -81,7 +81,7 @@ module LogicalConstruct
|
|
81
81
|
setting :target_protocol, "http"
|
82
82
|
setting(:target_address, nil).isnt(:copiable)
|
83
83
|
setting :target_port, 51076
|
84
|
-
setting :resolutions
|
84
|
+
setting :resolutions
|
85
85
|
setting :marshalling_path, "marshall"
|
86
86
|
|
87
87
|
setting(:secret_data, nested {
|
@@ -103,8 +103,8 @@ module LogicalConstruct
|
|
103
103
|
})
|
104
104
|
|
105
105
|
setting :json_attribs_path
|
106
|
-
setting :roles
|
107
|
-
setting :node_attribs
|
106
|
+
setting :roles
|
107
|
+
setting :node_attribs
|
108
108
|
setting :json_attribs, ""
|
109
109
|
|
110
110
|
def default_configuration(core)
|
@@ -113,6 +113,9 @@ module LogicalConstruct
|
|
113
113
|
self.cookbooks.path = "cookbooks"
|
114
114
|
self.secret_data.path = "data-bags/secret"
|
115
115
|
self.normal_data.path = "data-bags"
|
116
|
+
self.resolutions = {}
|
117
|
+
self.roles = {}
|
118
|
+
self.node_attribs = { "run_list" => [] }
|
116
119
|
end
|
117
120
|
|
118
121
|
def resolve_configuration
|
@@ -146,8 +149,11 @@ module LogicalConstruct
|
|
146
149
|
in_namespace do
|
147
150
|
directory marshalling_path
|
148
151
|
|
149
|
-
task :collect, [:ipaddr
|
152
|
+
task :collect, [:ipaddr] do |task, args|
|
150
153
|
self.target_address = args[:ipaddr]
|
154
|
+
end
|
155
|
+
|
156
|
+
task :build_json_attribs, [:role] do |task, args|
|
151
157
|
unless args[:role].nil?
|
152
158
|
self.node_attribs["run_list"] = roles[args[:role]]
|
153
159
|
end
|
@@ -155,6 +161,11 @@ module LogicalConstruct
|
|
155
161
|
resolutions["chef_config:json_attribs"] ||= json_attribs
|
156
162
|
end
|
157
163
|
|
164
|
+
desc "Print attribs (optionally: for :role)"
|
165
|
+
task :inspect_attribs, [:role] => :build_json_attribs do
|
166
|
+
puts json_attribs
|
167
|
+
end
|
168
|
+
|
158
169
|
file secret_data.tarball_path => [marshalling_path] + secret_data.file_list do
|
159
170
|
cmd("tar", "--exclude **/*.sw?", "-czf", secret_data.tarball_path, secret_data.path).must_succeed!
|
160
171
|
end
|
@@ -170,17 +181,24 @@ module LogicalConstruct
|
|
170
181
|
cmd("tar", "--exclude .git", "--exclude **/*.sw?", "-czf", cookbooks.tarball_path, cookbooks.path).must_succeed!
|
171
182
|
end
|
172
183
|
|
173
|
-
manifest = LogicalConstruct::GenerateManifest.new(self, :manifest =>
|
184
|
+
manifest = LogicalConstruct::GenerateManifest.new(self, :manifest =>
|
185
|
+
[
|
186
|
+
cookbooks.tarball_path,
|
187
|
+
secret_data.tarball_path,
|
188
|
+
normal_data.tarball_path,
|
189
|
+
:collect
|
190
|
+
]) do |manifest|
|
174
191
|
manifest.receiving_name = "configuration:Manifest"
|
175
192
|
end
|
176
193
|
|
177
|
-
WebConfigure.new(:web_configure => [:collect, :manifest, cookbooks.tarball_path]) do |task|
|
194
|
+
WebConfigure.new(:web_configure => [:collect, :build_json_attribs, :manifest, cookbooks.tarball_path]) do |task|
|
178
195
|
self.proxy_settings_to(task)
|
179
196
|
task.target_address = proxy_value.target_address
|
180
197
|
end
|
181
198
|
end
|
182
199
|
|
183
|
-
|
200
|
+
desc "Provision :ipaddr with specified configs (optionally: for :role)"
|
201
|
+
task root_task, [:ipaddr, :role] => self[:web_configure]
|
184
202
|
end
|
185
203
|
end
|
186
204
|
end
|
@@ -28,14 +28,13 @@ module LogicalConstruct
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def define
|
31
|
-
|
31
|
+
task base_name => [target_dir, valise.find("templates/" + source_path).full_path, Rake.application.rakefile] do
|
32
32
|
finalize_configuration
|
33
|
-
p extra
|
34
33
|
File::open(target_path, "w") do |file|
|
35
34
|
file.write render(source_path)
|
36
35
|
end
|
37
36
|
end
|
38
|
-
|
37
|
+
task base_name => target_dir
|
39
38
|
task :local_setup => target_path
|
40
39
|
end
|
41
40
|
end
|
@@ -86,7 +85,6 @@ module LogicalConstruct
|
|
86
85
|
end
|
87
86
|
end
|
88
87
|
end
|
89
|
-
desc "Template files to be created on the remote server"
|
90
88
|
task root_task => [rakefile.target_path] + in_namespace(:standalone)
|
91
89
|
task root_task => [initd.target_path] + in_namespace(:standalone)
|
92
90
|
task :local_setup => root_task
|
@@ -13,7 +13,7 @@ module LogicalConstruct
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def define
|
16
|
-
remote_task(:create
|
16
|
+
remote_task(:create) do |task|
|
17
17
|
task.command = cmd "mkdir", "-p", construct_dir
|
18
18
|
end
|
19
19
|
task :remote_groundwork => self[:create]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logical-construct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: corundum
|
16
|
-
requirement: &
|
16
|
+
requirement: &75949720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.0.1
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *75949720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mattock
|
27
|
-
requirement: &
|
27
|
+
requirement: &75947710 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.3.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *75947710
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sinatra
|
38
|
-
requirement: &
|
38
|
+
requirement: &75945230 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.3.3
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *75945230
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rest-client
|
49
|
-
requirement: &
|
49
|
+
requirement: &75955280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.6.7
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *75955280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: nokogiri
|
60
|
-
requirement: &
|
60
|
+
requirement: &76199670 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -69,10 +69,10 @@ dependencies:
|
|
69
69
|
- 4
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
|
-
version_requirements: *
|
72
|
+
version_requirements: *76199670
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: json
|
75
|
-
requirement: &
|
75
|
+
requirement: &76197300 !ruby/object:Gem::Requirement
|
76
76
|
none: true
|
77
77
|
requirements:
|
78
78
|
- - ! '>='
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
version: '0'
|
81
81
|
type: :runtime
|
82
82
|
prerelease: false
|
83
|
-
version_requirements: *
|
83
|
+
version_requirements: *76197300
|
84
84
|
description: ! ' Like Vagrant? Missing AWS? Here you go. Limited Rakefiles to
|
85
85
|
do something like that.
|
86
86
|
|
@@ -144,7 +144,7 @@ rdoc_options:
|
|
144
144
|
- --main
|
145
145
|
- doc/README
|
146
146
|
- --title
|
147
|
-
- logical-construct-0.0.
|
147
|
+
- logical-construct-0.0.5 RDoc
|
148
148
|
require_paths:
|
149
149
|
- lib/
|
150
150
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash: -
|
158
|
+
hash: -522629425
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|