Skip to content

coderanger/chef-funnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Here Be Dragons

Okay, consider yourself warned. The funnel cookbook provides a way to write Chef recipes in Javascript or Python. Just put a .js or .py file in your recipes folder just like you would with a normal Ruby recipe.

Example Javascript recipe

The resource syntax is a pretty direct mapping from Ruby:

package('ntp');

file('/tmp/something', {
  owner: 'root',
  mode: '600',
  content: 'secret'
});

file('/tmp/something', {
  action: 'delete'
});

template('/tmp/another', {
  source: 'test.erb',
  variables: {
    name: node.name(),
    server: node.fqdn
  }
});

Example Python recipe

As above, pretty simple mapping, except all methods live under the chef module. The node object is not yet exposed to Python:

import chef

chef.package('ntp')

chef.file('/tmp/something',
    owner='root',
    mode='600',
    content='secret')

# You can also import * if you prefer
from chef import file, template

file('/tmp/something', action='delete')

template('/tmp/another',
    source='test.erb',
    variables={
      'name': 'localhost',
    })

Why?

Because I can. Using this in production will probably result in your servers catching fire.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages