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

[dev] lanpowerg5k generators

parent 293e439f
luxembourg:
petitprince:
lanpower:
suffix: '-bmc -I lanplus'
nancy:
graphite:
lanpower:
suffix: "-bmc -I lanplus -C 3"
graphique:
lanpower:
suffix: "-bmc -I lanplus -C 3"
sleep: "4"
command_delay: 15
graoully:
lanpower:
suffix: "-bmc -I lanplus -C 3"
sleep: "4"
command_delay: 15
grimoire:
lanpower:
suffix: "-bmc -I lanplus -C 3"
sleep: "4"
command_delay: 15
grisou:
lanpower:
suffix: "-bmc -I lanplus -C 3"
sleep: "4"
command_delay: 15
grenoble:
adonis:
conman:
......@@ -13,16 +41,36 @@ grenoble:
workaround_flag: solpayloadsize
lille:
chimint:
lanpower:
sleep: '3'
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chinqchint:
lanpower:
sleep: '3'
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
chirloute:
lanpower:
sleep: '3'
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
lyon:
hercule:
lanpower:
sleep: '3'
suffix: '-bmc -I lanplus'
orion:
lanpower:
sleep: '3'
suffix: '-bmc -I lanplus'
taurus:
lanpower:
sleep: '3'
suffix: '-bmc -I lanplus'
sagittaire:
lanpower:
sleep: '3'
conman:
device: /usr/lib/conman/exec/sun-v20z-v40z.exp
nantes:
......@@ -34,7 +82,14 @@ reims:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
rennes:
parasilo:
lanpower:
bmc: ipmi2
sleep: '4'
command_delay: 15
paranoia:
lanpower:
sleep: '4'
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
parapide:
......@@ -43,7 +98,12 @@ rennes:
parapluie:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
ceph[0-3]:
paravance:
lanpower:
bmc: ipmi2
sleep: '4'
command_delay: 15
ceph:
conman:
device: /usr/lib/conman/exec/ipmiconsole.exp
sophia:
......
#!/usr/bin/ruby
# This script generates lanpowerg5k/files/<site_uid>/lanpower.conf from conf/console.yaml and conf/console-password.conf
require 'pp'
require 'yaml'
require 'fileutils'
require '../lib/input_loader'
require '../lib/hash/hash.rb'
$output_dir = 'output'
password = YAML::load_file('conf/console-password.yaml')
console = YAML::load_file('conf/console.yaml')
refapi = load_yaml_file_hierarchy("../input/grid5000/")
refapi["sites"].each { |site_uid, site|
h = {'clusters' => {} }
site['clusters'].sort.each { |cluster_uid, cluster_refapi|
cluster_console = console[site_uid][cluster_uid]['lanpower'] rescue nil
cluster_password = password[site_uid].fetch(cluster_uid)
# clusters:
# griffon:
# bmc: "ipmi"
# user: ""
# password: ""
# suffix: "-bmc"
# sleep: "6"
cluster_hash = {}
cluster_hash['bmc'] = cluster_console.fetch('bmc') rescue 'ipmi'
cluster_hash['user'] = cluster_password.split(' ')[0]
cluster_hash['password'] = cluster_password.split(' ')[1]
cluster_hash['sleep'] = cluster_console.fetch('sleep') rescue '6'
cluster_hash['command_delay'] = cluster_console.fetch('command_delay') rescue nil
cluster_hash['suffix'] = cluster_console.fetch('suffix') rescue nil
cluster_hash['suffix'] = cluster_refapi['nodes']["#{cluster_uid}-1"]['network_adapters']['bmc'].fetch('network_address').split('.')[0].gsub("#{cluster_uid}-1",'') rescue '-bmc' unless cluster_hash['suffix']
cluster_hash.reject!{ |k,v| v == nil }
h['clusters'][cluster_uid] = cluster_hash
} # clusters.each
# Write output file
output_file = File.join($output_dir, 'lanpowerg5k', 'files', site_uid, 'lanpower.yaml')
dirname = File.dirname(output_file)
FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
write_yaml(output_file, h)
}
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