# HG changeset patch # User Igor Chubin # Date 1263231416 -7200 # Node ID f652fab38c7a2fe37a9981f42a3a7316748d5ff9 # Parent 6c145935ece529d2cfce391f10d55b86aec13e59 ec2 parameters small fixes diff -r 6c145935ece5 -r f652fab38c7a files/ec2-instances --- a/files/ec2-instances Mon Jan 11 13:01:35 2010 +0200 +++ b/files/ec2-instances Mon Jan 11 19:36:56 2010 +0200 @@ -100,6 +100,15 @@ ec2-attach-volume -d /dev/sdb -i `head -1 $NETWORK-instances` $VOLUME_NAME } +unlock_root_account() +{ + for i in `seq 0 $((INSTANCES_NUMBER-1))` + do + host=$NETWORK-node$i.$DOMAIN + ssh -i $SSH_SECRET_KEY ubuntu@$host "sudo sh -c 'cat .ssh/authorized_keys > /root/.ssh/authorized_keys'" + done +} + configure_instances() { #FIXME: Only for managed hosts! Not for all! @@ -136,6 +145,7 @@ update_dns ssh_keys attach_block_device +unlock_root_account configure_instances message "* Starting emulators" start_emulators diff -r 6c145935ece5 -r f652fab38c7a files/prepare-ec2-instance --- a/files/prepare-ec2-instance Mon Jan 11 13:01:35 2010 +0200 +++ b/files/prepare-ec2-instance Mon Jan 11 19:36:56 2010 +0200 @@ -19,6 +19,7 @@ hostname $HOSTNAME touch /root/.hushlogin export DEBIAN_FRONTEND=noninteractive + perl -p -i -e 's/universe/universe multiverse/' /etc/apt/sources.list pkill apt-get ; pkill dpkg ; sleep 5; pkill apt-get; pkill dpkg ; sleep 5 dpkg --configure -a apt-get -q -y update diff -r 6c145935ece5 -r f652fab38c7a xentaur.py --- a/xentaur.py Mon Jan 11 13:01:35 2010 +0200 +++ b/xentaur.py Mon Jan 11 19:36:56 2010 +0200 @@ -28,7 +28,11 @@ # ec2 settings ec2_dns_domain='ec2.xgu.ru' -ec2_zone="us-east-1a" +ec2_zone="eu-west-1b" +ec2_volume_name="vol-86d234ef" +ec2_ssh_secret_key="~/.ec2/id_rsa-eu-keypair" +ec2_ssh_keypair="eu-keypair" +ec2_ami="ami-a62a01d2" domain='dyn1' from xendomain import * @@ -120,11 +124,10 @@ f.write(""" NETWORK=%(network)s INSTANCES_NUMBER=%(instances_number)s -INSTANCE_AMI=ami-b21ff8db -INSTANCE_AMI=ami-7cfd1a15 -VOLUME_NAME=vol-28d13141 -SSH_SECRET_KEY=~/.ec2/id_rsa-pstam-keypair -SSH_KEYPAIR=pstam-keypair +INSTANCE_AMI=%(ec2_ami)s +VOLUME_NAME=%(ec2_volume_name)s +SSH_SECRET_KEY=%(ec2_ssh_secret_key)s +SSH_KEYPAIR=%(ec2_ssh_keypair)s EC2_ZONE=%(ec2_zone)s DOMAIN=%(ec2_dns_domain)s SCRIPTS_PATH=%(path_scripts)s @@ -135,7 +138,12 @@ "ec2_dns_domain" : ec2_dns_domain, "ec2_zone" : ec2_zone, + "ec2_ssh_secret_key": ec2_ssh_secret_key, + "ec2_ssh_keypair" : ec2_ssh_keypair, + "ec2_volume_name" : ec2_volume_name, + "ec2_ami" : ec2_ami, }) + f.write("start_emulators()\n{\n%s\n}\n"%make_start_emulators()) f.close()