I'm trying to bootstrap a machine with a recipe that contains a call to cookbook_ file resource with action:create. The following issue occurs during execution (some information has been redacted):
FATAL: Chef::Exceptions::FileNotFound: cookbook_file[/path/to/file]
(XXXX::default line 25) had an error: Chef::Exceptions::FileNotFound:
Cookbook 'XXXX' (0.1.0) does not contain a file at any of these
locations: files/default/file files/second_folder/file
I checked my /chef/cookbooks/cookbook_name/recipe/files/default and /second_folder directories, and the files required are there, but Chef is just refusing to recognize them. I'm not sure what could be causing this issue. Any help is much appreciated.
Your source file
fileshould be placed on your cookbook at:Then you should use the cookbook_file as follow:
You can also place your
fileon a different folder from default one as your second_folder for example:This way you should specify on source also the not default directory as follow: