diff --git a/deploy/README b/deploy/README index d3cde0140..e9a16b3e0 100644 --- a/deploy/README +++ b/deploy/README @@ -19,6 +19,10 @@ knife ec2 server create -r 'role[webserver]' -I ami-7000f019 -f m1.small # you can run this to get the servers you have running, as well as their ip addresses knife ec2 server list +# set it as a variable so you can reuse it +export RTFDHOST=X.X.X.X + + # if you ever want to start over from scratch you can destroy the instance by doing knife ec2 delete i-xxxxxxx @@ -26,7 +30,7 @@ knife ec2 delete i-xxxxxxx # ssh to the machine -ssh -i ~/.ssh/rtfd.pem ubuntu@X.X.X.X +ssh -i ~/.ssh/rtfd.pem ubuntu@$RTFDHOST sudo su - edit .ssh/authorized_keys @@ -39,16 +43,16 @@ edit .ssh/authorized_keys pip install fabric # install chef on the ec2 server -fab install_chef -H X.X.X.X -i ~/.ssh/rtfd.pem +fab install_chef -H $RTFDHOST -i ~/.ssh/rtfd.pem # sync the chef scripts to the server # Make sure to have your key in ssh-agent for rsync to use eval `ssh-agent` ssh-add ~/.ssh/rtfd.pem -fab sync_config -H X.X.X.X -i ~/.ssh/rtfd.pem +fab sync_config -H $RTFDHOST -i ~/.ssh/rtfd.pem # sync and run chef on the ec2 instance -fab update -H X.X.X.X -i ~/.ssh/rtfd.pem +fab update -H $RTFDHOST -i ~/.ssh/rtfd.pem diff --git a/deploy/fabfile.py b/deploy/fabfile.py index 10ff8305f..f9f8fe1f7 100755 --- a/deploy/fabfile.py +++ b/deploy/fabfile.py @@ -12,7 +12,9 @@ env.chef_executable = '/var/lib/gems/1.8/bin/chef-solo' def install_chef(): sudo('apt-get update', pty=True) sudo('apt-get install -y git-core libopenssl-ruby rubygems ruby ruby-dev', pty=True) - sudo('gem install chef --no-ri --no-rdoc', pty=True) + #sudo('gem install chef --no-ri --no-rdoc', pty=True) + sudo('gem install chef --no-ri --no-rdoc -V 0.10.2', pty=True) + def sync_config(): local('rsync -av . %s@%s:/etc/chef' % (env.user, env.hosts[0]))