In order to get started, lets first familiarize with the stack cookbooks.
The cookbooks repo located here: https://github.com/the-startup-stack/stack-cookbooks is actually a bit more then just the cookbooks, it's everything you need to bootstrap your initial cluster.
├── Cheffile ├── Cheffile.lock ├── Gemfile ├── Gemfile.lock ├── bin ├── bundle ├── cookbooks ├── dockerfiles ├── environments ├── roles ├── site-cookbooks └── terraform
Lets dive into these
Those are exactly like Gemfiles, meaning this will tell the
librarian-chef command (you'll see where we use it later), which version to download. This essentially locks the development against specific versions of the cookbooks.
These are Rubygems that we use during the development of the cookbooks.
Those are bundle and binstubs for ruby.
All the cookbook dependencies.
Mind you, this directory is there for
librarian-chef, even if you find something you need to change there (which you should not), never change it in place. You need to fix the cookbook and deploy it to Gibhub and update through librarian.
I know this sounds a bit complex, but we'lll get there.
This is where we put all the Dockerfile for the project.
The startup stack comes right out of the gate with pre-built support for environemtns. This means you have
production by default.
The environment files are just JSON files that lock cookbook versions on the
chef-server for specific environments.
For example, lets say we are working on the
stack-logger cookbook, we want to bump the version only on
staging all the while
production is locked to previous version and can run chef without worrying about new bugs.
The stack does not run cookbooks on servers or instances without a defined role.
Roles are ways to tell chef which cookbooks to run but in a more declarative way.
For example, one of the roles we have is
base, this is the role for all instances, and we have
stats role for graphite.
So, Graphite server essentially will be bootstrapped with
Don't worry too much about the terminology right now, it'll be explained further when we need it.
This is our cookbooks. this is where we customize the behavior for our servers.
Configurations are devided into logical directories in order to make sure the files are manageable
This project is big, we try to put everything in place.
It should be pretty straight forward to navigate around the project.