This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Chef Cookbook Wizardry

Project Description

========
Helps build cookbooks faster by pre-templating parts and exposing
options in a command line and config friendly way.

Installation

The latest release of fastfood can be installed via pip:

pip install fastfood
An alternative install method would be manually installing it leveraging
setup.py:
git clone https://github.com/rackerlabs/fastfood
cd fastfood
python setup.py install

Command Line Usage

list

Shows a list of available stencils in your template pack.

Example:

$ fastfood list
Available Stencil Sets:
       varnish - Creates a recipe for installing Varnish
      ha-redis - Creates a highly available Redis and HAProxy recipe
          java - Installs Java JRE

show

Shows more information about a stencil, including available options.

$ fastfood show nginx
Stencil Set nginx:
  Stencils:
    nginx
  Options:
    name - Name of the recipe to create
    example - Various premade Nginx examples

build

Generates a new cookbook or updates an existing cookbook from a fastfood.json
file.

Example Template:

{
  "name": "mycookbook",
  "stencils": [
    {
      "stencil_set": "base"
    },
    {
      "stencil_set": "rabbitmq",
      "openfor": "myapp"
    },
    {
      "stencil_set": "rails",
      "stencil": "nginx",
      "name": "myapp",
      "tag": "myapp"
    }
  ]
}

Ex:

fastfood build fastfood.json

Template Notes

Fastfood uses the Jinja2 templating engine with
2 modifications.

qstring()

There is a helper method added to jinja2 for fastfood called qstring, it
takes in an argument and if that argument does not match a Chef node
attributes (node[‘mysomething’] | node.chef_environment) it will wrap that argument
in a string otherwise it just returns the argument.
qstring("node['mysomething']")

renders as

node['mysomething']

and

qstring("mynonchefstr")

renders as

"mynonchefstr"

jinja variable

Because the traditional jinja2 variable start and end strings can conflict
with Ruby code fastfood uses ‘|{‘ and ‘}|’ to represent a jinja2 variable.
|{ options['name'] }|
Release History

Release History

This version
History Node

1.1.0

History Node

1.0.0

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.9

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fastfood-1.1.0-py2.py3-none-any.whl (22.9 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jul 21, 2015
fastfood-1.1.0.tar.gz (14.4 kB) Copy SHA256 Checksum SHA256 Source Jul 21, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting