Commit b20b1824 authored by Jérémie Gaidamour's avatar Jérémie Gaidamour
Browse files

[nancy] Added kavlan info. Fixed error eth2 grisou.

parent 01b9721c
nodes:
<% (1..144).each { |i| %>
graphene-<%= i %>:
<% i93 = i+92 %>
kavlan:
eth0:
kavlan-1: 192.168.194.<%= i %>
kavlan-2: 192.168.210.<%= i %>
kavlan-3: 192.168.226.<%= i %>
kavlan-4: 10.16.2.<%= i %>
kavlan-5: 10.16.66.<%= i %>
kavlan-6: 10.16.130.<%= i %>
kavlan-7: 10.16.194.<%= i %>
kavlan-8: 10.17.2.<%= i %>
kavlan-9: 10.17.66.<%= i %>
kavlan-11: 10.7.200.<%= i93 %>
kavlan-12: 10.11.200.<%= i93 %>
kavlan-13: 10.15.200.<%= i93 %>
kavlan-14: 10.19.200.<%= i93 %>
kavlan-16: 10.27.200.<%= i93 %>
kavlan-18: 10.35.200.<%= i93 %>
kavlan-19: 10.39.200.<%= i93 %>
kavlan-20: 10.43.200.<%= i93 %>
kavlan-21: 10.47.200.<%= i93 %>
<% } %>
......@@ -25,5 +25,25 @@ nodes:
18:fb:7b:9b:91:d3
18:fb:7b:9b:af:d9
)[i-1] %>
kavlan:
eth0:
<% i143 = i + 142 %>
kavlan-1: 192.168.201.<%= i %>
kavlan-2: 192.168.217.<%= i %>
kavlan-3: 192.168.232.<%= i %>
kavlan-4: 10.16.9.<%= i %>
kavlan-5: 10.16.73.<%= i %>
kavlan-6: 10.16.137.<%= i %>
kavlan-7: 10.16.201.<%= i %>
kavlan-8: 10.17.9.<%= i %>
kavlan-9: 10.17.73.<%= i %>
kavlan-11: 10.7.201.<%= i143 %>
kavlan-12: 10.11.201.<%= i143 %>
kavlan-13: 10.15.201.<%= i143 %>
kavlan-14: 10.19.201.<%= i143 %>
kavlan-16: 10.27.201.<%= i143 %>
kavlan-18: 10.35.201.<%= i143 %>
kavlan-19: 10.39.201.<%= i143 %>
kavlan-20: 10.43.201.<%= i143 %>
kavlan-21: 10.47.201.<%= i143 %>
<% } %>
nodes:
<% (1..4).each { |i| %>
graphite-<%= i %>:
<% i237 = i+236 %>
kavlan:
eth0:
kavlan-1: 192.168.196.<%= i %>
kavlan-2: 192.168.212.<%= i %>
kavlan-3: 192.168.228.<%= i %>
kavlan-4: 10.16.4.<%= i %>
kavlan-5: 10.16.68.<%= i %>
kavlan-6: 10.16.132.<%= i %>
kavlan-7: 10.16.196.<%= i %>
kavlan-8: 10.17.4.<%= i %>
kavlan-9: 10.17.68.<%= i %>
kavlan-11: 10.7.200.<%= i237 %>
kavlan-12: 10.11.200.<%= i237 %>
kavlan-13: 10.15.200.<%= i237 %>
kavlan-14: 10.19.200.<%= i237 %>
kavlan-16: 10.27.200.<%= i237 %>
kavlan-18: 10.35.200.<%= i237 %>
kavlan-19: 10.39.200.<%= i237 %>
kavlan-20: 10.43.200.<%= i237 %>
kavlan-21: 10.47.200.<%= i237 %>
<% } %>
\ No newline at end of file
nodes:
<% [*1..29, *58..60].each { |i| %>
griffon-<%= i %>:
kavlan:
eth0:
kavlan-1: 192.168.193.<%= i %>
kavlan-2: 192.168.209.<%= i %>
kavlan-3: 192.168.225.<%= i %>
kavlan-4: 10.16.1.<%= i %>
kavlan-5: 10.16.65.<%= i %>
kavlan-6: 10.16.129.<%= i %>
kavlan-7: 10.16.193.<%= i %>
kavlan-8: 10.17.1.<%= i %>
kavlan-9: 10.17.65.<%= i %>
kavlan-11: 10.7.200.<%= i %>
kavlan-12: 10.11.200.<%= i %>
kavlan-13: 10.15.200.<%= i %>
kavlan-14: 10.19.200.<%= i %>
kavlan-16: 10.27.200.<%= i %>
kavlan-18: 10.35.200.<%= i %>
kavlan-19: 10.39.200.<%= i %>
kavlan-20: 10.43.200.<%= i %>
kavlan-21: 10.47.200.<%= i %>
<% } %>
......@@ -56,7 +56,6 @@ nodes:
kavlan-13: 10.15.201.<%= i166_174 %>
kavlan-14: 10.19.201.<%= i166_174 %>
kavlan-16: 10.27.201.<%= i166_174 %>
kavlan-17: 10.31.201.<%= i166_174 %>
kavlan-18: 10.35.201.<%= i166_174 %>
kavlan-19: 10.39.201.<%= i166_174 %>
kavlan-20: 10.43.201.<%= i166_174 %>
......
......@@ -58,19 +58,19 @@ nodes:
24:6e:96:03:0b:a0
24:6e:96:03:24:20
)[i-1] %>
<% i61_111 = i + 60 %>
<% i121_171 = i + 120 %>
<% i181_231 = i + 180 %>
<% if i < 50 %>
eth1:
<% i61_111 = i + 60 %>
ip: 172.16.72.<%= i61_111 %>
eth2:
<% i121_171 = i + 120 %>
ip: 172.16.72.<%= i121_171 %>
eth3:
<% i181_231 = i + 180 %>
ip: 172.16.72.<%= i181_231 %>
<% else %>
eth2:
ip: 172.18.72.<%= i %>
ip: 172.16.72.<%= i121_171 %>
<% end %>
bmc:
ip: 172.17.72.<%= i %>
......
......@@ -59,48 +59,48 @@ refapi["sites"].each { |site_uid, site|
entries = {}
["networks", "laptops", "dom0"].each { |key|
entries[key] ||= []
# # ["networks", "laptops", "dom0"].each { |key|
# # entries[key] ||= []
site[key].each { |uid, node|
if node['network_adapters'].nil?
puts "Warning: no network_adapters for #{uid}"
next
end
eth_net_uid = node['network_adapters'].select{ |u, h| h['mounted'] && /^eth[0-9]$/.match(u) } # eth* interfaces
node['network_adapters'].each { |net_uid, net_hash|
hostsuffix = nil
if ! eth_net_uid.include?(net_uid) && node['network_adapters'].size > 1
hostsuffix = "-#{net_uid}"
end
# # site[key].each { |uid, node|
# # if node['network_adapters'].nil?
# # puts "Warning: no network_adapters for #{uid}"
# # next
# # end
# # eth_net_uid = node['network_adapters'].select{ |u, h| h['mounted'] && /^eth[0-9]$/.match(u) } # eth* interfaces
# # node['network_adapters'].each { |net_uid, net_hash|
# # hostsuffix = nil
# # if ! eth_net_uid.include?(net_uid) && node['network_adapters'].size > 1
# # hostsuffix = "-#{net_uid}"
# # end
new_entry = {
:uid => uid,
:hostsuffix => hostsuffix, # cacahuete vs. cacahuete-eth0
:ip => net_hash['ip'],
}
# # new_entry = {
# # :uid => uid,
# # :hostsuffix => hostsuffix, # cacahuete vs. cacahuete-eth0
# # :ip => net_hash['ip'],
# # }
entries[key] << new_entry
}
}
}
# # entries[key] << new_entry
# # }
# # }
# # }
# PDUs
entries['pdus'] ||= []
site['pdus'].each { |pdu_uid, pdu|
if pdu['ip']
# # # PDUs
# # entries['pdus'] ||= []
# # site['pdus'].each { |pdu_uid, pdu|
# # if pdu['ip']
new_entry = {
:uid => pdu_uid,
:ip => pdu['ip']
}
# # new_entry = {
# # :uid => pdu_uid,
# # :ip => pdu['ip']
# # }
entries['pdus'] << new_entry
# # entries['pdus'] << new_entry
end
}
# # end
# # }
site.fetch("clusters").sort.each { |cluster_uid, cluster|
#next if cluster_uid != 'griffon'
......@@ -109,8 +109,9 @@ refapi["sites"].each { |site_uid, site|
network_adapters = {}
# Nodes
pp node_uid
node.fetch('network_adapters').each { |net_uid, net_hash|
network_adapters[net_uid] = {"ip" => net_hash["ip"], "mounted" => net_hash["mounted"]}
network_adapters[net_uid] = {"ip" => net_hash["ip"], "mounted" => net_hash["mounted"]} #, "network_address" => net_hash["network_address"]}
}
# Kavlan
......@@ -127,6 +128,8 @@ refapi["sites"].each { |site_uid, site|
# Group ip ranges
network_adapters.each { |net_uid, net_hash|
next if node['status'] && node['status']['retired'] && cluster_uid == 'graphene' && net_uid == 'eth0' # FIXME
next unless net_hash['ip']
entries["#{cluster_uid}-#{net_uid}"] ||= []
......@@ -136,7 +139,7 @@ refapi["sites"].each { |site_uid, site|
ip = net_hash['ip']
ip_array = ip.split('.')
if last_entry and ip == last_entry[:ip] + '.' + (node_id + last_entry[:shift]).to_s and last_entry[:end] == node_id-1
if last_entry && ip == last_entry[:ip] + '.' + (node_id + last_entry[:shift]).to_s && last_entry[:end] == node_id-1 # && network_address
last_entry[:end] += 1
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment