ec2plone

 

Automating Things

Page history last edited by pigeonflight 1 yr ago

Thanks to the API you can get alot of mileage via simple scripts:

 

Example:

 

 # This script can be run in a directory with the appropriate keypair

 ELASTIC_IP=75.1.2.3 #change this

 KEYPAIR=supersecure_key #change this

 # get know_hosts out of the way

 known_hosts_tmp=/tmp/known_hosts$$

 mv ~/.ssh/known_hosts $known_hosts_tmp

#TODO: make it launch the instance and bind the ip etc..

sshcommand="ssh -i $KEYPAIR root@$ELASTIC_IP"

$sshcommand uname -a

#prepare the instance

$sshcommand [ -a fancyscript ] && rm fancyscript

$sshcommand  wget serverwithstuff.com/fancyscript

$sshcommand  sh fancyscript

# get known_hosts back

mv $known_hosts_tmp ~/.ssh/known_hosts

 

In the example above 'fancyscript' could possible call a buildout etc...

Comments (0)

You don't have permission to comment on this page.