Commit eabe633b authored by Jérémie Gaidamour's avatar Jérémie Gaidamour

[dev] fixed various bugs

parent 9f167f3b
......@@ -101,8 +101,7 @@ refapi["sites"].each { |site_uid, site|
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
......@@ -111,7 +110,7 @@ refapi["sites"].each { |site_uid, site|
entries[key] << new_entry
}
}
} unless site[key].nil?
}
# PDUs
......@@ -127,7 +126,7 @@ refapi["sites"].each { |site_uid, site|
entries['pdus'] << new_entry
end
}
} unless site['pdus'].nil?
site.fetch("clusters").sort.each { |cluster_uid, cluster|
#next if cluster_uid != 'griffon'
......
......@@ -99,29 +99,32 @@ global_hash["sites"].each { |site_uid, site_hash|
"nodes" => site_hash[key],
"network_adapters" => ["eth", "bmc", "adm"],
"optional_network_adapters" => ["bmc", "adm"]
})
}) unless site_hash[key].nil?
}
#
# PDUs
#
# Relocate ip/mac info of PDUS
site_hash['pdus'].each { |pdu_uid, pdu_hash|
if pdu_hash['ip'] && pdu_hash['mac']
pdu_hash['network_adapters'] ||= {}
pdu_hash['network_adapters']['pdu'] ||= {}
pdu_hash['network_adapters']['pdu']['ip'] = pdu_hash.delete('ip')
pdu_hash['network_adapters']['pdu']['mac'] = pdu_hash.delete('mac')
end
}
key = 'pdus'
write_dhcp_file({
"filename" => key + ".conf",
"site_uid" => site_uid,
"nodes" => site_hash['pdus'],
"network_adapters" => ['pdu'],
})
if ! site_hash['pdus'].nil?
# Relocate ip/mac info of PDUS
site_hash['pdus'].each { |pdu_uid, pdu_hash|
if pdu_hash['ip'] && pdu_hash['mac']
pdu_hash['network_adapters'] ||= {}
pdu_hash['network_adapters']['pdu'] ||= {}
pdu_hash['network_adapters']['pdu']['ip'] = pdu_hash.delete('ip')
pdu_hash['network_adapters']['pdu']['mac'] = pdu_hash.delete('mac')
end
}
key = 'pdus'
write_dhcp_file({
"filename" => key + ".conf",
"site_uid" => site_uid,
"nodes" => site_hash['pdus'],
"network_adapters" => ['pdu'],
"optional_network_adapters" => []
})
end
}
......@@ -17,7 +17,7 @@ require '../lib/hash/hash.rb'
global_hash = load_yaml_file_hierarchy("../../input/grid5000/")
$output_dir = ENV['puppet_repo'] || '/tmp/puppet-repo'
$conf_dir = ENV['conf_dir'] || Pathname("#{$output_dir}/modules/lanpowerg5k/generators/")
$conf_dir = ENV['conf_dir'] || Pathname("#{$output_dir}/modules/kadeployg5k/generators/")
raise("Error: #{$conf_dir} does not exist. The environment variables are not set propertly") unless Pathname($conf_dir).exist?
# Compute cluster prefix
......
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