This cookbook is designed to make setting up a Ruby web server on a VPS using Chef quite simple.
To use the cookbook, it's best to use Matt Schaffer's
Knife Solo using the instructions below.
I recommend using Digital Ocean.
The cookbook will install the following stack:
- Ruby 2.0
- rbenv
- PostgreSQL
- Apache2
- Phusion Passenger
- Node.js
- ImageMagick
gem install knife-solo
gem install berkshelf
knife solo init vps-provisioner
berks init vps-provisioner
cd vps-provisioner
## ./Gemfile
source 'https://rubygems.org'
gem 'knife-solo'
gem 'berkshelf'
## ./Berksfile
site :opscode
cookbook 'ruby_web_server', git: '[email protected]:rossjourdain/ruby_web_server_cookbook.git'
bundle install
berks install --path cookbooks
knife solo prepare <user>@<server>
## ./nodes/<server>.json
## NB: password generated using: mkpasswd -m sha-512 deploy
{
"run_list": [
"ruby_web_server"
],
"users": {
"deploy": {
"password": "$6$Jz61tUIPAEBc4R69$.77ruWIRf36yQ9ySPL2qObbu54jduoCCMUDb.28khUr95YYnuj5AKhslLnGAqSPBEolHC5MNm0yAExSoC6FKy.",
"ssh_keys": [""]
}
},
"webapps": {
"test_app": {
"domain": "www.example.com",
"rails_env": "production"
}
},
"locale": {
"lang": "en_NZ.utf8"
},
"postgresql": {
"password": {
"postgres": "postgres"
}
}
}
knife solo cook <user>@<server>
TODO
TODO
TODO
TODO