alpha_omega 0.0.223 → 0.0.224
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alpha_omega/utils.rb +4 -18
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.224
|
data/lib/alpha_omega/utils.rb
CHANGED
@@ -54,8 +54,6 @@ module AlphaOmega
|
|
54
54
|
|
55
55
|
node["run_list"].concat $pods_config[env_pod]["run_list"] if $pods_config[env_pod].key? "run_list"
|
56
56
|
|
57
|
-
node["cap_group"] << "all"
|
58
|
-
|
59
57
|
node["cap_group"].concat $pods_config[env_pod]["cap_group"] if $pods_config[env_pod].key? "cap_group"
|
60
58
|
|
61
59
|
node
|
@@ -64,10 +62,6 @@ module AlphaOmega
|
|
64
62
|
def self.default_pods_tasks
|
65
63
|
Proc.new do |config, pod_name, pod, this_node, &node_filter|
|
66
64
|
%w(app echo yaml).each do |tsuffix|
|
67
|
-
# world task accumulates all.* after tasks
|
68
|
-
config.task "world.#{tsuffix}" do # task world
|
69
|
-
end
|
70
|
-
|
71
65
|
# each pod task sets the pod context for host/group tasks
|
72
66
|
config.task "#{pod_name}.#{tsuffix}" do # task pod1
|
73
67
|
set :current_pod, pod_name
|
@@ -113,14 +107,6 @@ module AlphaOmega
|
|
113
107
|
end
|
114
108
|
|
115
109
|
self.what_groups hosts do |task_name, nodes|
|
116
|
-
if task_name == "all"
|
117
|
-
# simulate all podXX all
|
118
|
-
%w(app echo yaml).each do |tsuffix|
|
119
|
-
config.after "world.#{tsuffix}", "#{pod_name}.#{tsuffix}" # podXX
|
120
|
-
config.after "world.#{tsuffix}", "#{task_name}.#{tsuffix}" # all
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
110
|
%w(app echo yaml).each do |tsuffix|
|
125
111
|
config.task "#{task_name}.#{pod_name}.#{tsuffix}" do
|
126
112
|
end
|
@@ -164,7 +150,7 @@ module AlphaOmega
|
|
164
150
|
|
165
151
|
# opsdb config
|
166
152
|
$opsdb = Dir["#{node_home}/config/pod/*.yaml"].inject({}) do |acc, fname|
|
167
|
-
env_pod = File.basename(
|
153
|
+
env_pod = File.basename(fname, ".yaml")
|
168
154
|
acc[env_pod] = YAML.load(File.read(fname))
|
169
155
|
acc
|
170
156
|
end
|
@@ -174,13 +160,13 @@ module AlphaOmega
|
|
174
160
|
|
175
161
|
this_host = ENV['_AO_THIS_HOST'] || Socket.gethostname.chomp.split(".")[0]
|
176
162
|
dna_base = "#{node_home}/pods/#{$this_pod}/#{this_host}"
|
177
|
-
dna =
|
163
|
+
dna = YAML.load(File.read("#{dna_base}.yaml"))
|
178
164
|
this_node = self.node_defaults(dna, $this_pod, this_host)
|
179
165
|
$this_host = this_node
|
180
166
|
|
181
167
|
((this_node["pods"] || []) + [$this_pod]).inject({}) do |pods, pod_name|
|
182
168
|
pods[pod_name] = {
|
183
|
-
"nodes_specs" => [ "#{node_home}/pods/#{pod_name}/*.yaml"
|
169
|
+
"nodes_specs" => [ "#{node_home}/pods/#{pod_name}/*.yaml" ],
|
184
170
|
"node_suffix" => (pod_name == $this_pod ? "" : ".#{pod_name}")
|
185
171
|
}
|
186
172
|
yield config, pod_name, pods[pod_name], this_node
|
@@ -192,7 +178,7 @@ module AlphaOmega
|
|
192
178
|
# load all the nodes and define cap tasks
|
193
179
|
pod["nodes_specs"].inject({}) do |hosts, spec|
|
194
180
|
Dir[spec].inject(hosts) do |acc, fname|
|
195
|
-
node_name = File.basename(
|
181
|
+
node_name = File.basename(fname, ".yaml")
|
196
182
|
|
197
183
|
node = YAML.load(IO.read(fname))
|
198
184
|
node["node_name"] = node_name
|