Question

Is there way to set default output path cookbooks to site-cookbooks when I run knife cookbook create?

I wrote cookbook_path in ~/.chef/knife.rb like this.

cookbook_path ['./site-cookbooks']

But this doesn't change default cookbook output path.

Was it helpful?

Solution

File expansion can be wonky in Ruby sometimes. If your site-cookbooks directory is at ~/site-cookbooks, then you could put in something like this in your knife.rb:

current_dir = File.dirname(__FILE__)
cookbook_path ["#{current_dir}/../site-cookbooks"]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top