xentaur

changeset 68:f652fab38c7a tip

ec2 parameters small fixes
author Igor Chubin <igor@chub.in>
date Mon Jan 11 19:36:56 2010 +0200 (2010-01-11)
parents 6c145935ece5
children
files files/ec2-instances files/prepare-ec2-instance xentaur.py
line diff
     1.1 --- a/files/ec2-instances	Mon Jan 11 13:01:35 2010 +0200
     1.2 +++ b/files/ec2-instances	Mon Jan 11 19:36:56 2010 +0200
     1.3 @@ -100,6 +100,15 @@
     1.4      ec2-attach-volume -d /dev/sdb -i `head -1 $NETWORK-instances` $VOLUME_NAME 
     1.5  }
     1.6  
     1.7 +unlock_root_account()
     1.8 +{
     1.9 +    for i in `seq 0 $((INSTANCES_NUMBER-1))`
    1.10 +    do
    1.11 +        host=$NETWORK-node$i.$DOMAIN
    1.12 +        ssh -i $SSH_SECRET_KEY ubuntu@$host "sudo sh -c 'cat .ssh/authorized_keys > /root/.ssh/authorized_keys'"
    1.13 +    done
    1.14 +}
    1.15 +
    1.16  configure_instances()
    1.17  {
    1.18  #FIXME: Only for managed hosts! Not for all!
    1.19 @@ -136,6 +145,7 @@
    1.20  update_dns
    1.21  ssh_keys
    1.22  attach_block_device
    1.23 +unlock_root_account
    1.24  configure_instances
    1.25  message "* Starting emulators"
    1.26  start_emulators
     2.1 --- a/files/prepare-ec2-instance	Mon Jan 11 13:01:35 2010 +0200
     2.2 +++ b/files/prepare-ec2-instance	Mon Jan 11 19:36:56 2010 +0200
     2.3 @@ -19,6 +19,7 @@
     2.4  	hostname $HOSTNAME
     2.5  	touch /root/.hushlogin
     2.6  	export DEBIAN_FRONTEND=noninteractive
     2.7 +    perl -p -i -e 's/universe/universe multiverse/' /etc/apt/sources.list
     2.8  	pkill apt-get ; pkill dpkg ; sleep 5; pkill apt-get; pkill dpkg ; sleep 5
     2.9  	dpkg --configure -a
    2.10       	apt-get -q -y update
     3.1 --- a/xentaur.py	Mon Jan 11 13:01:35 2010 +0200
     3.2 +++ b/xentaur.py	Mon Jan 11 19:36:56 2010 +0200
     3.3 @@ -28,7 +28,11 @@
     3.4  
     3.5  # ec2 settings
     3.6  ec2_dns_domain='ec2.xgu.ru'
     3.7 -ec2_zone="us-east-1a"
     3.8 +ec2_zone="eu-west-1b"
     3.9 +ec2_volume_name="vol-86d234ef"
    3.10 +ec2_ssh_secret_key="~/.ec2/id_rsa-eu-keypair"
    3.11 +ec2_ssh_keypair="eu-keypair"
    3.12 +ec2_ami="ami-a62a01d2"
    3.13  
    3.14  domain='dyn1'
    3.15  from xendomain import *
    3.16 @@ -120,11 +124,10 @@
    3.17      f.write("""
    3.18  NETWORK=%(network)s
    3.19  INSTANCES_NUMBER=%(instances_number)s
    3.20 -INSTANCE_AMI=ami-b21ff8db
    3.21 -INSTANCE_AMI=ami-7cfd1a15
    3.22 -VOLUME_NAME=vol-28d13141
    3.23 -SSH_SECRET_KEY=~/.ec2/id_rsa-pstam-keypair
    3.24 -SSH_KEYPAIR=pstam-keypair
    3.25 +INSTANCE_AMI=%(ec2_ami)s
    3.26 +VOLUME_NAME=%(ec2_volume_name)s
    3.27 +SSH_SECRET_KEY=%(ec2_ssh_secret_key)s
    3.28 +SSH_KEYPAIR=%(ec2_ssh_keypair)s
    3.29  EC2_ZONE=%(ec2_zone)s
    3.30  DOMAIN=%(ec2_dns_domain)s
    3.31  SCRIPTS_PATH=%(path_scripts)s
    3.32 @@ -135,7 +138,12 @@
    3.33  
    3.34          "ec2_dns_domain"    : ec2_dns_domain,
    3.35          "ec2_zone"          : ec2_zone,
    3.36 +        "ec2_ssh_secret_key": ec2_ssh_secret_key,
    3.37 +        "ec2_ssh_keypair"   : ec2_ssh_keypair,
    3.38 +        "ec2_volume_name"   : ec2_volume_name,
    3.39 +        "ec2_ami"           : ec2_ami,
    3.40      })
    3.41 +
    3.42      f.write("start_emulators()\n{\n%s\n}\n"%make_start_emulators())
    3.43      f.close()
    3.44