#!/usr/bin/env python from Cheetah.Template import Template # General config items base = { 'template' : 'xrootd-pool-pe1950.ks.tmpl', 'tmpl_dir' : '../templates/sl6/', 'tmpl_incl_dir' : '../templates/sl6/include/', 'url' : 'http://mirror.msulocal/mirror/scientific/6.3/x86_64/os', 'netmask_priv' : '255.255.240.0', 'gateway_priv' : '10.10.128.1', 'nameserver_priv' : '10.10.128.8,10.10.128.9', 'ntpserver_priv' : '10.10.128.8', 'netmask_pub' : '255.255.254.0', 'gateway_pub' : '192.41.236.1', 'repo_local' : 'repo --name="AGLT2 Repo 6/x86_64" --baseurl=http://mirror.msulocal/mirror/aglt2/6/x86_64', 'omsa_ver' : 'OMSA_7.1', } # Node specific config items node = { 'hostname_short' : 'msut3-xrootd-p0', 'hostname_pub' : 'msut3-xrootd-p0.aglt2.org', 'dev_priv' : 'eth0', 'dev_pub' : 'p2p1', 'ip_priv' : '10.10.128.92', 'ip_pub' : '192.41.236.92', 'disk' : '/dev/disk/by-path/pci-0000:02:08.0-sas-0x1221000000000000-lun-0', 'rootpw' : '$6$GoGreen!!$8tySC5W8uSuDsOi3AMNDqz6al9gOFuYJd13Uw3jUgYHKhYYy/KWTsrVkLQukfy.3kaCp5Rvdosj9gDiYsgccl/', 'omsa_type' : 'pe1950', } tmpl_src = base['tmpl_dir'] + '/' + base['template'] tmpl = Template(file=tmpl_src, searchList = [base, node]) # simple print #print str(tmpl) #write to file ks = open( 'output/' + node['hostname_short'] + '.ks', 'w') ks.write( str(tmpl) ) ks.close()