I'm writing a chef cookbook recipe which aims to place a file onto a node server.
cookbook_file "/path/to/node/dir/file_name" do
source "file_name"
owner "ec2-user"
group "ec2-user"
end
I intend to allow a user of this cookbook to place the source file in his/her knife solo repository's "site-cookbooks" directory.
The problem is this configuration throws Chef::Exceptions::FileNotFound: Cookbook 'my-cookbook' (0.1.0) does not contain a file at any of these locations: ...
upon knife solo cook
deployment.
I tried specifying different cookbook_path
options in the knife solo repository's .chef/knife.rb
file but was unsuccessful.
What is the right way to achieve this? Or does chef not work like this and if so, what is the preferred alternative methodology? Is this a sign I should consolidate the cookbook and the knife solo repository into a single knife solo repository?