The Berksfile is Berkshelf specific, while the metadata file is built into Chef.
Adding your dependencies to the metadata file allows other applications, like librarian-chef or the supermarket, to read your dependencies as well.
Note that Berkshelf reads the dependencies from metadata as well, as long as you add the metadata
line to the Berksfile.
I strongly recommend specifying all dependencies in your metadata file, and using your Berksfile to point to where specific cookbooks are stored if they're not available in the supermarket (like Github, or a local path).
depends 'nginx'
in metadata.rb. But in case 'nginx' is located somewhere else (e.g. Github), I need also to addcookbook 'nginx', github: <nginx-url-repo>
. Is it right? – Stoltzfus