I am trying to use a Policyfile to configure an Artifactory repo as the source for a cookbook. I am using manual upload / curl to publish the cookbook to a /chef
repo in artifactory (this is new too) - i wasn't able to publish with stove and want to avoid knife-art for now. The chef install
run fails.
I am not sure if it's a fault with the upload or the chef install, and am not getting debug info from chef.
cookbook upload
curl --user "myuser:API_KEY" --data-binary @mycookbook.tar.gz -X PUT https://my-artifactory-server/artifactory/chef/mycookbook.tar.gz
I have also tried adding it to /chef/mycookbook/mycookbook.tar.gz
. There are no versions in the path or artifact name, but the metadata is valid. Are versions required?
Policyfile.rb
default_source :artifactory, "https://my-artifactory-server/artifactory/chef"
cookbook 'mycookbook'
run_list 'mycookbook::default'
I have tried with /artifactory/api/chef/
and /artifactory/api/chef/chef
as the URI too. ARTIFACTORY_API_KEY variable is set to my user API key.
From a directory with the policyfile, I run chef install -D
- not much info from debugging, but this is the output i get.
$ chef install --debug
Building policy mypol
Expanded run list: recipe[mycookbook::default]
Caching Cookbooks...
Error: Failed to generate Policyfile.lock
Reason: (Solve::Errors::NoSolutionError) Unable to satisfy the following requirements:
- `mycookbook (>= 0.0.0)` required by `user-specified dependency`
Have tried looking through the Artifactory logs to get an idea of what might be wrong, but not seeing much - requests.log shows a GET on /artifactory/api/chef/chef/universe
which returns an OK with {}
for the body - so assuming the cookbook isn't being added to a cookbook listing of some sort? Artifactory version is 5.10.
I have tried adding a virtual repo that serves the "chef" local repo and update policyfile with that, but get the same result.