Skip to main content

Chef Cookbook Wizardry

Project description

latest pypi release Build Status on Travis for 'master' branch Requirements Status from requires.io

========
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'] }|

Project details


Download files

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

Source Distribution

fastfood-1.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

fastfood-1.1.0-py2.py3-none-any.whl (22.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fastfood-1.1.0.tar.gz.

File metadata

  • Download URL: fastfood-1.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fastfood-1.1.0.tar.gz
Algorithm Hash digest
SHA256 969d2352ad29ba4ebb802ffbe25569b40e433286433a0371ae0f2e946f449460
MD5 fb884c2aa1959fdb1b4a04ed8b5a77de
BLAKE2b-256 4bea43e04a36e83018e47d4c40382ba9d142a4d26117dbd72a30ed48d0711ee8

See more details on using hashes here.

File details

Details for the file fastfood-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fastfood-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a9b6776a4d00c9011f28ca710e69cd8e2ff476e5c24855a03c35a971d4ff3e8b
MD5 0be8dcd5db7582b79fbfe931a3470535
BLAKE2b-256 5c6f5ff610a667418178c34f972903e43ee8ca1c421f0961ccef65e242bc7f0d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page