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

[dev] moved conman configuration

parent 7d4a1f56
......@@ -75,9 +75,6 @@ nodes:
gpu_count: 2
gpu_vendor: Nvidia
gpu_model: Tesla-C1060
conman:
device: ipmi
workaround_flag: solpayloadsize
adonis-1:
chassis:
......
......@@ -94,9 +94,6 @@ nodes:
version: "1.7"
gpu:
gpu: false
conman:
device: ipmi
workaround_flag: solpayloadsize
edel-10:
chassis:
......
......@@ -60,6 +60,3 @@ nodes:
gpu: false
monitoring:
wattmeter: false
conman:
device: ipmi
workaround_flag: solpayloadsize
......@@ -73,8 +73,6 @@ nodes:
gpu: false
monitoring:
wattmeter: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chimint-1:
chassis:
......
......@@ -56,5 +56,3 @@ nodes:
gpu: false
monitoring:
wattmeter: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
......@@ -81,8 +81,6 @@ nodes:
gpu_model: Tesla-S2050
monitoring:
wattmeter: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chirloute-6:
chassis:
......
......@@ -74,8 +74,6 @@ nodes:
metric: power
www:
url: http://wattmetre.lyon.grid5000.fr/GetWatts-json.php
conman:
device: /usr/lib/conman/exec/sun-v20z-v40z.exp
sagittaire-[70-79]:
storage_devices:
......
......@@ -82,8 +82,6 @@ nodes:
sensors:
power:
available: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
econome-1:
chassis:
......
......@@ -73,8 +73,6 @@ nodes:
mounted: false
gpu:
gpu: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
stremi-1:
chassis:
......
......@@ -99,8 +99,6 @@ nodes:
sensors:
power:
available: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
paranoia-1:
chassis:
......
......@@ -101,8 +101,6 @@ nodes:
management: true
gpu:
gpu: false
conman:
device: /usr/lib/conman/exec/sun-ilom.exp
parapide-1:
chassis:
......
......@@ -104,8 +104,6 @@ nodes:
ipmi:
sensors:
ambient: Inlet Ambient
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
parapluie-1:
chassis:
......
......@@ -14,6 +14,10 @@ virt_ip_range: 10.156.0.0/14
storage5k: true
production: true
# needed by puppet generators
servers:
ceph[0-3]:
g5ksubnet:
network: 10.156.0.0/14
gateway: 10.159.255.254
......@@ -62,8 +66,3 @@ kavlans:
16:
network: 10.27.192.0/18
gateway: 10.27.255.254
servers:
ceph[0-3]:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
......@@ -44,8 +44,6 @@ nodes:
gpu: false
monitoring:
wattmeter: false
conman:
device: /usr/lib/conman/exec/sun-elom.exp
sol-[1-28]:
network_adapters:
......
......@@ -72,8 +72,6 @@ nodes:
gpu: false
monitoring:
wattmeter: false
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
suno-11:
chassis:
......
......@@ -155,3 +155,9 @@ end
def deep_copy(o)
Marshal.load(Marshal.dump(o))
end
class NilClass
def clone()
nil
end
end
grenoble:
adonis:
conman:
device: ipmi
workaround_flag: solpayloadsize
edel:
conman:
device: ipmi
workaround_flag: solpayloadsize
genepi:
conman:
device: ipmi
workaround_flag: solpayloadsize
lille:
chimint:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chinqchint:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chirloute:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
lyon:
sagittaire:
conman:
device: /usr/lib/conman/exec/sun-v20z-v40z.exp
nantes:
econome:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
reims:
stremi:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
rennes:
paranoia:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
parapide:
conman:
device: /usr/lib/conman/exec/sun-ilom.exp
parapluie:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
ceph[0-3]:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
sophia:
sol:
conman:
device: /usr/lib/conman/exec/sun-elom.exp
suno:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
......@@ -11,10 +11,11 @@ require '../lib/hash/hash.rb'
global_hash = load_yaml_file_hierarchy("../input/grid5000/")
$output_dir = 'output'
conf_hash = YAML::load_file('./conf/conman-password.yaml')
pwd_hash = YAML::load_file('./conf/console-password.yaml')
conf_hash = YAML::load_file('./conf/console.yaml')
conf_hash = conf_hash.expand_square_brackets()
def write_conman_file(site_uid, site, passwd)
def write_conman_file(site_uid, site, conf, passwd)
erb = ERB.new(File.read("templates/conman.erb"))
output_file = File.join($output_dir, 'conmang5k', 'files', site_uid, 'conman.conf')
......@@ -30,5 +31,5 @@ end
# Loop over Grid'5000 sites
global_hash["sites"].each { |site_uid, site|
write_conman_file(site_uid, site, conf_hash[site_uid])
write_conman_file(site_uid, site, conf_hash[site_uid], pwd_hash[site_uid])
}
......@@ -5,28 +5,37 @@ server logfile="/var/log/conman.log"
# Input data:
#
# node_uid:
# network_adapters:
# bmc:
# network_address: node_uid-bmc.site.grid5000.fr
# conman:
# device: /usr/lib/conman/exec/ipmitool.exp
# /or/
# conman:
# device: ipmi
# workaround_flag: solpayloadsize
# * from input/ (site hash) :
#
# node_uid:
# network_adapters:
# bmc:
# network_address: node_uid-bmc.site.grid5000.fr
#
# * from conf/console.yaml (conf hash):
#
# conman:
# device: /usr/lib/conman/exec/ipmitool.exp
# /or/
# conman:
# device: ipmi
# workaround_flag: solpayloadsize
#
# * from conf/console-password.yaml: passwd hash
[site['clusters'], { 'servers' => { 'nodes' => site['servers'] || {} } }].each { |clusters|
clusters.sort.each { |cluster_uid, cluster|
cluster['nodes'].each_sort_by_node_uid { |node_uid, node|
cluster_uid = /[A-Za-z]*/.match(node_uid).to_s if cluster_uid == 'servers' # deduce cluster_uid from node_uid for 'servers' entries
password = passwd[node_uid] || passwd[cluster_uid] # this allows setting password on a cluster or node basis
put "#{node_uid}; password not found" unless passwd
password = passwd[node_uid] || passwd[cluster_uid] # this allows setting passwords on a cluster or node basis
puts "#{node_uid}; password not found" unless password
bmc = node['network_adapters']['bmc'].fetch('network_address').split('.')[0] rescue node_uid + '-bmc'
dev = node['conman'].fetch('device') rescue '/usr/lib/conman/exec/ipmitool.exp'
dev = conf[node_uid]['conman'].fetch('device') rescue nil
dev = conf[cluster_uid]['conman'].fetch('device') rescue '/usr/lib/conman/exec/ipmitool.exp' if dev == nil
if dev != 'ipmi'
# External process-based connection (default)
# Example : console name="node_uid" dev="/usr/lib/conman/exec/ipmitool.exp node_uid-bmc login password"
......@@ -36,8 +45,11 @@ server logfile="/var/log/conman.log"
# Example : console name="node_uid" dev="ipmi:node_uid-bmc" ipmiopts="U:login,P:password,W:workaround_flag"
dev = "#{dev}:#{bmc}"
login, pass = password.split(' ')
opt = conf[node_uid]['conman'].fetch('workaround_flag') rescue nil
opt = conf[cluster_uid]['conman'].fetch('workaround_flag') rescue nil if opt == nil
ipmiopts = "U:#{login},P:#{pass}"
ipmiopts += ",W:#{node['conman'].fetch('workaround_flag')}" rescue ''
ipmiopts += ",W:#{opt}" if opt != nil
end
%>console name="<%= node_uid %>" dev="<%= dev %><%= " #{dev_args}" if dev_args %>"<%= " ipmiopts=\"#{ipmiopts}\"" if ipmiopts %>
......
Supports Markdown
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