
#open channel
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
#log into infrastructure org
key = client.auth.login(INFRA_LOGIN, INFRA_PASSWD)
aKeys = client.activationkey.listActivationKeys(key)
for iKey in aKeys:
if iKey['key'] == AKName or iKey['key'].split('-')[1] == AKName:
fKey = iKey
break
else:
print "No activation key matched: ", AKName
client.auth.logout(key)
exit(-3)
aKS = client.kickstart.listKickstarts(key)
for iKS in aKS:
if iKS['label'] == KSName:
fKS = iKS
break
else:
print "No kickstart matched: ", KSName
client.auth.logout(key)
exit(-4)
client.kickstart.profile.keys.addActivationKey(key, fKS['label'], fKey['key'])
#log out from infrastructure channel
client.auth.logout(key)
if __name__ == "__main__":
sys.exit(main())
g) prep_RHEVHost.sh – script to prepare the required storage that:
• installs the RHEV hypervisor RPM
• generates the PXE boot file from installed hypervisor
• creates the cobbler distribution and profile
#!/bin/bash
#source variables
if [[ -x varDefs.sh ]]
then
source varDefs.sh
elif [[ -x /root/varDefs.sh ]]
then
source /root/varDefs.sh
elif [[ -x /root/resources/varDefs.sh ]]
www.redhat.com 68
Comentarios a estos manuales