Feature request: passing chef recipe as a block

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Feature request: passing chef recipe as a block

Andrew Havens
Hello,

I've been using Vagrant for about a year now and I love it! So thanks for all the hard work you put in to make it so great. I was thinking about the process I go through when I set up a new project to use Vagrant. I always seem to need to create a recipe for the sole purpose of interacting with a few LWRPs that I can't do in the Vagrant file. I think it would be cool if there was a way to pass a block to the add_recipe command. For example:

  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = "cookbooks"
    chef.add_recipe "apache2"
    chef.add_recipe do
      web_app "my_site" do
        docroot "/srv/www/my_site"
      end
    end
  end

For the times where I only need to write a few lines of a recipe, this feature would be really helpful for keeping things clean.

Just a thought.

--Andrew