How to use/implement this Chef recipe?

223 views Asked by At

I am really new with Chef, but am trying to use this Chef recipe:

https://gist.github.com/kardeiz/7273938

I thought that I needed to create a new cookbook and put the recipe into default.rb, and the .erb into templates/default, but when I try to use the cookbook ("dcpromote") in chef-client, I am getting an error:

Compiling Cookbooks...

================================================================================
Recipe Compile Error in c:/chef/cache/cookbooks/dcpromote/recipes/default.rb
================================================================================

NameError
---------
uninitialized constant Windows::Helper

Cookbook Trace:
---------------
  c:/chef/cache/cookbooks/dcpromote/recipes/default.rb:8:in `from_file'

Can anyone tell me why I am getting that compile error and how to eliminate it?

Thanks, Jim

1

There are 1 answers

0
Roland On BEST ANSWER

Looks like you need to depend on the windows cookbook from https://supermarket.chef.io/cookbooks/windows / github: https://github.com/opscode-cookbooks/windows.

Try adding the following to your cookbook's metadata.rb

depends 'windows'