alpha_omega 0.0.76 → 0.0.77
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.
- data/lib/alpha_omega/utils.rb +27 -21
- data/lib/alpha_omega/version.rb +1 -1
- metadata +3 -3
data/lib/alpha_omega/utils.rb
CHANGED
@@ -63,7 +63,7 @@ module AlphaOmega
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.default_pods_tasks
|
66
|
-
Proc.new do |config, pod_name, pod, mix_pods, pods_config, opsdb, this_pod|
|
66
|
+
Proc.new do |config, pod_name, pod, mix_pods, pods_config, opsdb, this_pod, &node_filter|
|
67
67
|
[ "", ".echo", ".yaml" ].each do |tsuffix|
|
68
68
|
# world task accumulates all.* after tasks
|
69
69
|
config.task "world#{tsuffix}" do
|
@@ -79,25 +79,30 @@ module AlphaOmega
|
|
79
79
|
AlphaOmega.what_hosts pod do |task_name, remote_name, node|
|
80
80
|
n = AlphaOmega.node_defaults(node, pods_config, opsdb, pod_name, this_pod, remote_name)
|
81
81
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
82
|
+
if node_filter.nil? || node_filter.call(n)
|
83
|
+
config.task "#{task_name}.#{pod_name}" do
|
84
|
+
role :app, remote_name
|
85
|
+
end
|
86
|
+
|
87
|
+
config.task "#{task_name}.#{pod_name}.echo" do
|
88
|
+
puts "#{AlphaOmega.magic_prefix} #{remote_name}"
|
89
|
+
end
|
90
|
+
|
91
|
+
config.task "#{task_name}.#{pod_name}.yaml" do
|
92
|
+
StringIO.new({ remote_name => n }.to_yaml).lines.each {|l| puts "#{AlphaOmega.magic_prefix} #{l}" }
|
93
|
+
end
|
94
|
+
|
95
|
+
[ "", ".echo", ".yaml" ].each do |tsuffix|
|
96
|
+
config.task "#{task_name}#{tsuffix}" do
|
97
|
+
after "#{task_name}#{tsuffix}", "#{task_name}.#{current_pod}#{tsuffix}"
|
98
|
+
end
|
97
99
|
end
|
98
|
-
end
|
99
100
|
|
100
|
-
|
101
|
+
puts "found #{n["node_name"]}"
|
102
|
+
n
|
103
|
+
else
|
104
|
+
nil
|
105
|
+
end
|
101
106
|
end
|
102
107
|
|
103
108
|
AlphaOmega.what_groups hosts do |task_name, nodes|
|
@@ -162,9 +167,9 @@ module AlphaOmega
|
|
162
167
|
end
|
163
168
|
end
|
164
169
|
|
165
|
-
def self.setup_pods (config, node_home, mix_pods = true)
|
170
|
+
def self.setup_pods (config, node_home, mix_pods = true, &node_filter)
|
166
171
|
self.what_pods(config, node_home) do |config, pod_name, pod, pods_config, opsdb, this_pod|
|
167
|
-
self.default_pods_tasks.call(config, pod_name, pod, mix_pods, pods_config, opsdb, this_pod)
|
172
|
+
self.default_pods_tasks.call(config, pod_name, pod, mix_pods, pods_config, opsdb, this_pod, &node_filter)
|
168
173
|
end
|
169
174
|
end
|
170
175
|
|
@@ -237,7 +242,8 @@ module AlphaOmega
|
|
237
242
|
node = YAML.load(IO.read(fname))
|
238
243
|
node["node_name"] = node_name
|
239
244
|
|
240
|
-
|
245
|
+
n = yield node_name, "#{node_name}#{pod["node_suffix"]}", node unless node["virtual"]
|
246
|
+
acc[node_name] = n if n
|
241
247
|
acc
|
242
248
|
end
|
243
249
|
end
|
data/lib/alpha_omega/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpha_omega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 133
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 77
|
10
|
+
version: 0.0.77
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|