Skip to content

Instantly share code, notes, and snippets.

@iafonov
Created August 14, 2012 13:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iafonov/3349101 to your computer and use it in GitHub Desktop.
Save iafonov/3349101 to your computer and use it in GitHub Desktop.
Chef git templates

Chef git templates

Chef should allow creating cookbooks and chef-repo using templates. It should maintain the ability to create artifacts offline but a special switch could be supplied to knife wich will tell it to clone the remote repository rather than create a hardcoded structure.

Use cases:

knife chef-repo create --template https://github.com/fnichol/chef-bootstrap-repo knife cookbook create ntpd --template https://github.com/test/cookbook-with-minitest-and-berkshelf

Basically knife should clone the repository into folder and remove .git directory.

The idea could be pushed to 11 by following the same implementation as rails uses. (http://edgeguides.rubyonrails.org/rails_application_templates.html)

@fnichol
Copy link

fnichol commented Aug 14, 2012

This is a great idea! I feature I use a lot when creating Rails applications. Plus Thor has some nice functionality like prompting if a file already exists (overwrite, keep existing, show diff, etc.).

@erikh
Copy link

erikh commented Aug 14, 2012

I wrote a small ERB templating system that integrates with highline to ask questions: https://github.com/erikh/askerb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment