Get the latest code from Github:
$ git clone git@github.com:noderabbit-team/clusterbuilder.git
Create an SSH key to use to login to the servers:
$ ssh-add cheftesting.pem
Install chef and knife-ec2 (assumes you have Ruby + gem installed already):
$ gem install chef $ gem install knife-ec2 $ gem install knife-github-cookbooks $ knife cookbook github install websterclay/chef-elb $ knife cookbook github install opscode/cookbooks/aws
Check for upstream changes:
$ knife cookbook github compare elb
Download the knife.kb file and your organization's .pem file from opscode.com.
Add these lines to the knife.rb file that you downloaded:
knife[:aws_access_key_id] = "#{ENV['AWS_ACCESS_KEY_ID']}" knife[:aws_secret_access_key] = "#{ENV['AWS_SECRET_ACCESS_KEY']}" knife[:aws_ssh_key_id] = 'cheftesting.pem' knife[:image] = "ami-61be7908" # ami-06ad526f (Natty 11.04) knife[:flavor] = 'm1.small'
Copy the keys and the knife config file to your keys dir:
$ cp nateaune.pem keys/ $ cp noderabbit-validator.pem keys/ $ cp cheftesting.pem keys/
Upload the cookbooks:
$ knife cookbook upload Uploading application [0.99.12] Uploading application_nginx [0.99.12] Uploading application_python [0.99.12] Uploading apt [1.1.1] Uploading aws [0.99.0] Uploading build-essential [1.0.0] Uploading database [1.0.0] Uploading gunicorn [1.0.0] Uploading nginx [0.99.0] Uploading openssl [0.1.0] Uploading packaginator [0.1.0] Uploading postgresql [0.11.1] Uploading python [1.0.2] Uploading redis [1.0.0] Uploading sudo [1.0.0] Uploading supervisor [0.1.0] Uploading users [1.0.0] Uploading xfs [0.1.0] upload complete
Now add the roles:
$ for f in roles/*.rb; do knife role from file `basename $f`; done Updated Role base! Updated Role packaginator! Updated Role packaginator_application_server! Updated Role packaginator_database_master! Updated Role packaginator_load_balancer! Updated Role packaginator_task_broker! Updated Role pkg! $ sh launch.sh ... ec2-75-101-231-121.compute-1.amazonaws.com Setting up chef (0.10.4-1) ... ec2-75-101-231-121.compute-1.amazonaws.com ec2-75-101-231-121.compute-1.amazonaws.com Creating config file /etc/chef/client.rb with new version ec2-75-101-231-121.compute-1.amazonaws.com * Starting chef-client chef-client ec2-75-101-231-121.compute-1.amazonaws.com ec2-75-101-231-121.compute-1.amazonaws.com [ OK ] ec2-75-101-231-121.compute-1.amazonaws.com ec2-75-101-231-121.compute-1.amazonaws.com Processing triggers for libc-bin ... ec2-75-101-231-121.compute-1.amazonaws.com ldconfig deferred processing now taking place ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:32 +0000] INFO: *** Chef 0.10.4 *** ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:33 +0000] INFO: Client key /etc/chef/client.pem is not present - registering ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:37 +0000] INFO: HTTP Request Returned 404 Not Found: Cannot load node i-060ad966 ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:39 +0000] INFO: Setting the run_list to ["role[base]", "role[packaginator_database_master]"] from JSON ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:40 +0000] INFO: Run List is [role[base], role[packaginator_database_master]] ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:40 +0000] INFO: Run List expands to [users::sysadmins, sudo, apt, build-essential, postgresql::server, packaginator::database] ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:40 +0000] INFO: Starting Chef Run for i-060ad966 ec2-75-101-231-121.compute-1.amazonaws.com [Sat, 10 Sep 2011 23:37:42 +0000] INFO: Loading cookbooks [application, application_nginx, application_python, apt, aws, build-essential, database, gunicorn, nginx, packaginator, postgresql, python, sudo, supervisor, users, xfs]
http://help.opscode.com/kb/knife/knife-plugins-ec2 http://www.nslms.com/2010/11/29/chef-for-rightscale-quick-start/