Closed spuder closed 9 years ago
I'll let @jakedavis speak up regarding using Vagrant on its own for testing this cookbook, but my encouragement would be to use Test Kitchen to test cookbooks.
This cookbook is really meant to be wrapped by a cookbook specific to your own needs, and that pattern is most easily followed by using Berkshelf (which this cookbook is set up to use).
I'd encourage installing the Chef DK to get all set up with Chef, Test Kitchen, Berkshelf, and a few other goodies to more easily test. You’ll still need Vagrant & VirtualBox/VMWare for local VMs, but it will drastically simplify things.
As an example, your wrapper cookbook would, at the very least, have a metadata.rb
something like this:
name 'your_zookeeper'
maintainer 'You'
maintainer_email 'you@evertrue.com'
license 'All rights reserved'
description 'Installs/Configures zookeeper'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.0'
depends 'zookeeper', '~> 2.5'
And a recipes/default.rb
like this:
#
# Cookbook Name:: your_zookeeper
# Recipe:: default
#
# Copyright (C) 2015 You
#
# All rights reserved - Do Not Redistribute
#
include_recipe 'zookeeper::default'
You can also override attributes & other things, or even take advantage of the separate recipes available in this cookbook, or even utilize the resources this cookbook provides directly.
+1 on TK and probably +1 on deprecating Vagrant.
fwiw, I have a sample wrapper up at https://github.com/solarce/zk-wrapper
Thanks, I am using test kitchen now.
Just realized that this cookbook comes from simple.com. I've been telling everyone about how awesome that bank is.
If you run vagrant up, then you will get a stacktrace from chef
If you look at the stack trace, it shows a missing dependency
I'm guessing this is a simple fix, but I am new to chef.