Franchise is a "framework" for managing debian based chef-solo installs. After pasting around various bits from different projects, I extracted them into a common generator, allowing you to create franchises easily. For an example of this structure see monitorbox.
- gem install berksfile (ruby 1.9 only)
- pip install fabric
- debian based host
Here's a high level view of the execution model:
- Berkshelf is run against a
Berksfile
, copying all cookbooks and their dependencies to thevendor/cookbooks
directory. If any custom cookbooks are specified, they are also copied fromcookbooks/
. - Fabric is run against a target host, along with the username and password (if needed).
- If this is the first time fabric runs, it will "bootstrap" the host, installing chef-solo and other support tools.
- Once bootstrapped, your cookbooks and roles are uploaded to the host.
- Chef-solo is run against your runlist, which runs through your cookbooks.
For more detail, view the fabfile.py.template
Clone the project:
git clone git@github.com:capotej/franchise.git ~/.franchise_sub
For bash users:
echo 'eval "$($HOME/.franchise_sub/bin/franchise init -)"' >> ~/.bash_profile
exec bash
For zsh users:
echo 'eval "$($HOME/.franchise_sub/bin/franchise init -)"' >> ~/.zshenv
source ~/.zshenv
Once installed, usage is very simple:
franchise new ircbox
This will create a franchise ircbox/
in the current directory.
cd ircbox
fab --user=root --password=hihaters chef:hosts=11.22.33.44
This will bootstrap the host and install the "ntp" recipe from opscode into 11.22.33.44
If the cookbook you want is an Opscode Community Cookbooks, you can just specify it in the Berksfile. See the Berkshelf website for more information on specifying dependencies via git or http.
IMPORTANT Once specified as a dependency, you need to chef to actually install it, this is done by adding the name of the cookbook to the runlist
Sometimes the cookbook you want to install isnt available or doesn't exist. In this case, just drop your cookbook into the cookbooks
directory and specify it in the Berksfile as such:
cookbook "runit", path: "cookbooks/runit"