Thursday, August 19, 2010

Alternative approach to changing WLS external listen address on EC2 image

Thanks to my colleague Prasen -

save the following as update_dns.py

import os

domainHome=os.environ['DOMAIN_HOME']
bpmServer=os.environ['BPM_SERVER_NAME']
ec2DNS=os.environ['ORACLE_HOSTNAME']
externalDNSNameKey='ExternalDNSName'

readDomain(domainHome)
cd ('Servers/'+bpmServer)
currentDNS=wl.get(externalDNSNameKey)
print "Replacing current DNS=%s with %s"%(currentDNS ,ec2DNS)
set(externalDNSNameKey, ec2DNS)
updateDomain()
closeDomain()
print ("EXternal DNS updated")

execute via $SOA_HOME/common/bin/wlst.sh

No comments: