-
Notifications
You must be signed in to change notification settings - Fork 0
Home
First, install Chef and then install Vagrant.
If you are planning to launch servers via Knife then you'll need to set up Opscode. Then, to launch a new instance on EC2 run the following command:
knife ec2 server create
-i ~/.ssh/level-business_rsa
-I "ami-3693a542"
-f m1.small
-G default,ui-stack
-N ui-server01
-r "recipe[apt],recipe[git],role[ui-server]"
--region eu-west-1
-S level-business_rsa
-x ubuntu
-Z eu-west-1a
See Ubuntu 10.04 LTS (Lucid Lynx) Daily Build for a list of available AMIs.
Chef is used to create installation scripts. It can be used with both VMs and remote servers. Installing Chef on your MacChef requires XCode before it can be installed. Installing XCodeUsing the Mac OS X Install DVD that came with your Mac, open the Optional Installs folder and then click on XCode to install (accept the default settings). Installing ChefLink your Chef configuration directory to your Chef directory on Dropbox:
ln -s ~/Dropbox/personal/config/chef ~/.chef
This will allow you to use the same configuration settings on multiple machines. Now run the following command to install Chef and Knife (you'll be prompted for your password because you are using sudo):
sudo gem install chef net-ssh net-ssh-multi fog highline knife-ec2 knife-github-cookbooks
#Install and configure VirtualBox
##Install VirtualBox
To install VirtualBox, first download VirtualBox, and then click on the image to mount it. Next, open a terminal window and run the command:
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.mpkg -target /Volumes/Macintosh\ HD
Finally, if you have installed the AddItemToDock utility then you can create a shortcut on the taskbar with:
additemtodock /Applications/VirtualBox.app
First, update RubyGems:
sudo gem update --system
Next install Vagrant:
sudo gem install vagrant
If you haven't done so already, read Why Vagrant?
If you are planning to use Chef to deploy additional servers outside of our normal cloud, then the following steps get you set up with Knife and Opsode.
First, sign up for a free account with Opscode:
https://community.opscode.com/users/new
Note that the first five nodes are free.
Next set up your keys as outlined in the step labelled You should set up your User and Organization on this page:
https://opscode.tenderapp.com/kb/start/2-setting-up-your-user-environment
The downloaded keys should be placed in the ~/.chef directory that you created in Install and configure Chef:
mv USERNAME.pem ~/.chef
mv ORGANIZATION-validator.pem ~/.chef
You can then verify your set-up by going into the Chef repository and running the client list command:
cd ~/Documents/workspace/chef-repo
knife client list
You should get something like:
[
"level-validator"
]
Uploading cookbooks and roles If you have just created a new organisation then you will need to upload the cookbooks and roles to Opscode:
knife cookbook upload -a
knife role from file roles/ui-server.rb