Skip to content

ChatSecure/chef-chatsecure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chatsecure.org chef repo

Chef is way better than provisioning servers by hand.

Vagrant

Install Vagrant, VirtualBox, and then install these plugins.

$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-berkshelf

Then you should be able to bring up the VM:

$ vagrant up

Provision the current roles/recipes defined in the Vagrantfile:

$ vagrant provision

Other useful commands are vagrant destroy to destroy the VM, vagrant ssh to ssh into the VM, vagrant halt and vagrant suspend to halt/suspend. Sometimes you have to do vagrant reload as well when changing VM configuration.

Deploying

Install the latest version of Chef, knife-solo, and berkshelf for your operating system.

$ gem install chef knife-solo berkshelf

Install chef-solo on the remote server with knife-solo:

$ knife solo prepare [email protected]

Provision the server with the latest cookbooks (similar to vagrant provision):

$ knife solo cook [email protected]

Clean it up

$ knife solo clean [email protected]

Data Bags

The data_bags directory should look like this:

groups
    groups.json
secrets
    secrets.json
ssl
    certs.json
    keys.json
user-passwords
	passwords.json
users
    user1.json
    user2.json
    user3.json

Nodes

For some reason chef-solo breaks if you include too much stuff in your json file. In the nodes directory include a node example.com.json:

{
   "name": "example.com",
   "postgresql": {
      "password": {
         "postgres": "example_password"
      }
   },
   "run_list": [
      "role[nginx]",
      "role[base]",
      "role[security]",
      "role[users]",
      "role[web]"
   ]
}

Git Deploys

Now you can deploy application code with git:

$ git remote add vagrant ssh://[email protected]:2222/var/git/chatsecure-web.git
$ git remote add production [email protected]:/var/git/chatsecure-web.git
$ git push production master

About

Chef Repo for chatsecure.org

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages