I have a cookbook (A) that downloads some file from one of our servers and another cookbook (B) uses this file.
My problem is that when I run chef client the file is not there until the run list completes. In my metadata file for cookbook(B) it depends on cookbook(A) and the first line of code in the recipe is include cookbook(A). I also have cookbook(A) before cookbook(B) within the run list. When I run chef client the first time it does not do what I want it to, it says cannot find the file. If I run it a second time it works exactly as it should.
This isn't really how Chef works. You can find a full description in https://coderanger.net/two-pass/ but briefly all recipes get compiled and then all resources get converged, regardless of cookbook/recipe divisions.