You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a cookbook in a git repository that resides in a subfolder hierarchy below the top level of the repository. I want to refer to this location in a cookbook source line in Policyfile.rb, similarly to how a Policyfile.lock.json can be targeted in an include_policy source. This is not supported right now.
Describe the Need:
Anyone who is storing cookbook content in git which doesn't reside at the top level of a repository.
Current Alternative
Clone the repository locally, provide a local path. This is easy enough in most cases, but in some it may be less preferable.
Et cetera
In Policyfile.rb, include_policy can do something like this:
---- Begin output of /usr/local/bin/chef-cli update /Users/tom/gh/chef-examples/examples/include-policy/dependendent_cookbook/Policyfile.rb ----
STDOUT: Building policy dependendent_cookbook
Expanded run list: recipe[base_cookbook::default], recipe[dependendent_cookbook::default]
Caching Cookbooks...
Installing dependendent_cookbook >= 0.0.0 from path
Installing base_cookbook >= 0.0.0 from git
STDERR: Error: Failed to generate Policyfile.lock
Reason: (CookbookOmnifetch::NotACookbook) The resource at '/var/folders/lr/_nvzwc7x3hjb9_09bh0wnpdm0000gn/T/d20210902-28012-13wmwb' does not appear to be a valid cookbook. Does it have a metadata.rb?
---- End output of /usr/local/bin/chef-cli update /Users/tom/gh/chef-examples/examples/include-policy/dependendent_cookbook/Policyfile.rb ----
Also, as an aside, parameters that are specified for either of these don't seem to get validated at all. path: isn't supported for cookbook, but why don't we see an error about this at some point prior? I can add anything: 'whatever' to this line, and I don't see any complaints/warnings.
The text was updated successfully, but these errors were encountered:
nrgetik
changed the title
Support paths in git and github sources for cookbook in Policyfile.rb
Support path in git and github sources for cookbook in Policyfile.rb
Sep 3, 2021
Describe the Enhancement:
I have a cookbook in a git repository that resides in a subfolder hierarchy below the top level of the repository. I want to refer to this location in a
cookbook
source line inPolicyfile.rb
, similarly to how aPolicyfile.lock.json
can be targeted in aninclude_policy
source. This is not supported right now.Describe the Need:
Anyone who is storing cookbook content in git which doesn't reside at the top level of a repository.
Current Alternative
Clone the repository locally, provide a local path. This is easy enough in most cases, but in some it may be less preferable.
Et cetera
In
Policyfile.rb
,include_policy
can do something like this:But
cookbook
can't:Also, as an aside, parameters that are specified for either of these don't seem to get validated at all.
path:
isn't supported forcookbook
, but why don't we see an error about this at some point prior? I can addanything: 'whatever'
to this line, and I don't see any complaints/warnings.The text was updated successfully, but these errors were encountered: