I followed the OpsCode quickstart guide and things went fairly smoothly, but now I'm running into issues experimenting with roles. I have a "starter" role in my repo that was provided by OpsCode. When I follow the first official documentation I could find and run the following from the top of my chef repo:
knife upload roles
it simply returns and nothing happens. I get no role (new or updated) on my chef server. The following line does work for creation and updating:
knife role from file .\roles\starter.rb
but I find it overly cumbersome and I would prefer something that just pushes my entire repo up to the server (or at least all of the roles) to make me more confident that everything is up to date.
Berkshelf command is similar to knife command and helps to upload cookbooks to Chef Server.
The following “knife cookbook upload” command will upload the cookbook that we created above to the Chef server. As we see, since this is the first version of this cookbook, it is showing the version number as 0.1. 0. # knife cookbook upload thegeekstuff Uploading thegeekstuff [0.1.
: a knife used for preparing food especially : a large, general-purpose kitchen knife usually 8 to 10 inches long that has a blade curving upward along its length and ending in a narrow point The chef's knife, usually 8 inches long, is … the workhorse of the kitchen.
Yeah, in this case Chef is a little bit inconsistent. I use the next 3 lines to push by whole repo to chef-server (of course after the tests have passed):
knife cookbook upload --all
knife role from file roles/*.rb
knife data bag from file --all
knife upload is based on the previous knife-essentials gem (now merged in chef under the name chef_fs).
https://github.com/opscode/chef/issues/1641 (and https://github.com/jkeiser/knife-essentials/issues/67) describe the issue: knife upload only support .json files for roles.
That's why your command knife upload
does not output anything.
If you want to use knife upload, you have to convert all roles to json first (https://gist.github.com/red56/834890 for an example)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With