Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config Added app-1, 2
data_bags initial commit
nodes We have now only app-3 instance.
roles recipes for logrotate
site-cookbooks restart service to re-open log when execute logrotate
.gitignore update knife to 0.0.3
Cheffile use xbuild instead of plenv to install perl 5.16.3
Cheffile.lock update xbuild
Gemfile update knife to 0.0.3
Gemfile.lock update knife to 0.0.3
README.md fix docs to use knife solo
Vagrantfile

README.md

Chef Cookbooks for PrePAN

Setup

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

ec2ssh

Make a file named '~/.ec2ssh' as below:

---
aws_keys:
  prepan:
    access_key_id:     your access key
    secret_access_key: your secret access key
regions:
  - us-west-1

Then setup your $HOME/.ssh/config:

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

Vagrant

You need to install Vagrant by the installer. You can get it from http://docs.vagrantup.com/v2/installation/index.html. See also http://docs.vagrantup.com/v2/installation/index.html for details.

Add the config to your ~/.ssh/config to enable SSH login:

Host local.prepan.org
  HostName 127.0.0.1
  User vagrant
  Port 2222
  IdentityFile ~/.vagrant.d/insecure_private_key

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

127.0.0.1 local.prepan.org

Chef cookbooks

Download dependent Chef cookbooks with librarian-chef:

$ bundle exec librarian-chef 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 local.prepan.org
$ bundle exec knife solo cook local.prepan.org

Provision Hosts on Production (EC2)

Prepare remote host:

$ bundle exec knife solo prepare ec2-user@app-1.us-west-1 -i ~/.ssh/prepan.pem

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

Then provision it:

$ bundle exec knife solo cook ec2-user@app-1.us-west-1 -i ~/.ssh/prepan.pem

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

$ bundle exec knife solo cook deployer@app-1.us-west-1 -i ~/.ssh/prepan.pem
Something went wrong with that request. Please try again.