I am using Chef Solo and trying to install a cookbook for Oh My Zsh! This results in this bothersome error:
Failed to read the private key /etc/chef/client.pem: Errno::ENOENT: No such file or directory - /etc/chef/client.pem
Based on what I gathered, this is being caused because the recipe has this line, which is trying to do a search:
search( :users, "shell:*zsh" ).each do |u|
I haven't found a satisfactory solution on how to fix this.
As I am a bit new to Chef, I wonder what I should do? It looks like search operation requires Chef Client, but does this mean if I want to use OMZ, I cannot use Chef Solo?
I ran into this problem today too. It seems like chef-solo doesn't support search() out of the box. Install https://github.com/edelight/chef-solo-search to fix the problem.
You can (probably) also use chef-zero instead of chef-solo.
From the README of chef-solo-search:
deprecation warning
Now that Local Mode ("Zero") has been introduced to Chef (as of 11.8), which offers search out of the box, this repository is going to get a lot less love. I highly reccomend that you consider migrating from Chef Solo to Chef Zero and drop use of this library. That being said, if you're stuck using Chef Solo, little chef-solo-search will still be there for you.
Here's an article walking through the migration:
https://www.chef.io/blog/2014/06/24/from-solo-to-zero-migrating-to-chef-client-local-mode/
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