auser / poolparty

Run a self-healing, auto-scaled and monitored cloud simply, in the clouds, on nearly any hardware, such as EC2, eucalyptus and vmware
http://www.poolpartyrb.com
MIT License
371 stars 54 forks source link

centos + more restrictive environments #37

Closed jashmenn closed 14 years ago

jashmenn commented 15 years ago

this issue is a placeholder for notes on using centos and more restrictive environments.

mklatsky commented 15 years ago

in my build_centos.sh I have made the follwoing change to set the hostname:

Replaced this block:

Set a hostname

if [ -z hostname ]; then hostname "poolparty" echo poolparty > /etc/hostname /etc/init.d/hostname.sh start 2>/dev/null fi

With:

Set a hostname

Grab the public IP address....

PUBLIC_IP=/usr/local/bin/ec2-metadata -o|cut -d " " -f 2 echo $PUBLIC_IP>/tmp/ip_addr HOST_NOT_SET=hostname|cut -d "-" -f 1 if [ $HOST_NOT_SET = "domU" ]; then hostname $HOSTNAME sed -i.bak s/localhost.localdomain/$HOSTNAME/g /etc/sysconfig/network echo "127.0.0.1 $HOSTNAME localhost.localdomain localhost" >/etc/hosts

fi

While I have ec2-metadata installed on my images, you can also use the "curl http://169.254.169.254/latest/meta-data/local-ipv4" method

The main problem is this is an instance by instance setup. I am still trying to figure out how to do a cloud-start, and ether explicitly assign from an array possibly, or use a pattern (i.e. cloud-start 5 instances, with the hostnames webX, webX+1, etc)