Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (74 sloc) 2.04 KB

Chef Cookbooks for PrePAN


Ruby Libraries

You have to install the gem libraries listed below:

  • knife-solo
  • librarian
  • ec2ssh

the gem libraries except ec2ssh are managed by bundler. So You can install these libraries by following commands.

$ gem install ec2ssh
$ gem install bundler
$ bundle install --path vendor/bundle


Set profiles and regions in a file named '~/.ec2ssh` as below.

profiles 'default', 'prepan'
regions *%w(us-west-1)

And set credentials for prepan in ~/.aws/credentials.

aws_access_key_id = your access key
aws_secret_access_key = your secret access key

Then setup your $HOME/.ssh/config:

$ ec2ssh init --path ~/.ssh/config
$ ec2ssh update


You need to install Vagrant by the installer. You can get it from . See also for details.

Add the config gotten by vagrant ssh-config to your ~/.ssh/config to enable SSH login:

vagrant ssh-config --host >> ~/.ssh/config

Then add the line below into your /etc/hosts:

Chef cookbooks

Init knife solo.

$ bundle exec knife solo init .

Download dependent Chef cookbooks with berkshelf:

$ bundle exec berks install

Provision Vagrant

Launch Vagrant at first:

$ vagrant up

This take a long while at the first time.

Then provision it:

$ bundle exec knife solo prepare
$ bundle exec knife solo cook

Provision Hosts on Production (EC2)

Prepare remote host:

$ bundle exec knife solo prepare -i ~/.ssh/prepan.pem

Edit node/${hostname}.json if it's not thre.

Then provision it:

$ bundle exec knife solo cook -i ~/.ssh/prepan.pem

From the 2nd time, you have to use deployer user for login user:

$ bundle exec knife solo cook -i ~/.ssh/prepan.pem