
SATELLITE_URL = "http://sat-vm.cloud.lab.eng.bos.redhat.com/rpc/api"
TENANT_LOGIN = "tenant"
TENANT_PASSWD = "24^gold"
TENANT_ENTITLE = [ 'monitoring_entitled', 'provisioning_entitled' ]
TENANT_PARENT = 'rhel-x86_64-server-5'
TENANT_CHILDREN = ['rhn-tools-rhel-x86_64-server-5', 'ourapps' ]
TENANT_PACKAGES = [ 'ntp', 'javaApp' ]
"""
Create Key for Java Application
"""
#open channel
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
#log into tenant org
key = client.auth.login(TENANT_LOGIN, TENANT_PASSWD)
#create key
tenant_ak = client.activationkey.create(key, 'tenantrheljava', 'Key for RHEL Node with
javaApp', TENANT_PARENT, TENANT_ENTITLE, False)
#Add child channels
client.activationkey.addChildChannels(key, tenant_ak, TENANT_CHILDREN)
#Add packages
client.activationkey.addPackageNames(key, tenant_ak, TENANT_PACKAGES)
#log out from infrastructure channel
client.auth.logout(key)
#print out the defined key
print "JavaApp activation key: ", tenant_ak
iii) importKS_tenant.py – import kickstart into RHN satellite
#!/usr/bin/python
"""
This script will create a kickstart from the content of the file passed.
The ks name will be derived from the filename - if basename is less than 6 chars, date is
appended
The org, kstree and VIRT type are determined by the global variable below
"""
import xmlrpclib
import os.path
import sys
import time
import datetime
www.redhat.com 74
Comentários a estes Manuais