0

I'm very new to Chef and I'm attempting to provision a VM on my vsphere node using "chef provisioning".

When I execute the following

chef-client -z -o 'my_company::vsphere' 'my_company::test_cluster'

I get the following error:

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: firewall

After doing some research, I came across this question and discussion: Why can't chef resolve my cookbooks?

Here Tejay Cardon, mentions that the berks path should be called out in the cookbook_path configuration in knife.rb (at least that's how I interpreted it). I added it and now my file looks like this:

# See https://docs.getchef.com/config_rb_knife.html for more information on knife configuration options

current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "empl1234"
client_key               "#{current_dir}/empl1234.pem"
chef_server_url          "https://my_chef_box/organizations/my_org"
cookbook_path            ["#{current_dir}/../cookbooks", "C:/Users/empl1234/.berkshelf/cookbooks"]

When I run the command outlined above, I still get the same error.

As I mentioned above, I am learning chef and so if the answer is obvious, please be kind about it. And I've done a lot of googling, so if the answer is "google it! I got the exact page you needed as the first link", then please give me the terms to google. :) Thanks!

Community
  • 1
  • 1
Jason Thompson
  • 4,643
  • 5
  • 50
  • 74
  • As a reminder: use of chef-provisioning for new projects is discouraged as the project is no longer under development. Since it sounds like you are new, you should probably stop and rebuild on top of Terraform, SparkleFormation, or something else. – coderanger Oct 01 '16 at 01:05
  • What reminder? There is no documentation that says that. If true, that is really frustrating for people trying to learn this technology. With Java, it's clear when things are deprecated. – Jason Thompson Oct 02 '16 at 21:15
  • 1
    I've got a post on it at https://coderanger.net/provisioning/. – coderanger Oct 02 '16 at 23:07

1 Answers1

3

Apparently I didn't read close enough. The answer is to export all dependencies using the following command:

berks vendor path_to_hold_cookbooks

Then put path_to_hold_cookbooks as the cookbook_path in .chef/knife.rb

Jason Thompson
  • 4,643
  • 5
  • 50
  • 74