Those particular knife commands are meant for using Knife to talk to a Chef Server; they’re not used for Chef Solo (so far as I’m aware). You can check the docs on Chef Solo here: http://docs.opscode.com/chef_solo.html
That private key error refers to the fact that, for Knife to talk to a Chef Server, you must have a private key generated by said Chef Server.
While I haven’t done it myself, it appears you can work around this; here’s a Gist I turned up that walks you through the process a bit, though it’s a bit light on details: https://gist.github.com/doitian/1501318.
You can, of course, also generate the roles, environments, etc. manually; it’s pretty straightforward JSON, and there are examples of each of these things online. From Chef’s own docs:
On March 17, 2014 at 8:49:01 AM, Venkat Chowdhary (email@example.com) wrote:
Can someone please help me? Do we have any plug in to create Roles, Environments in chef-solo like how we do using knife (knife environment create ENVIRONMENT, knife role create ROLE).
Thanks & Regards
On Monday, 17 March 2014 12:53 PM, Venkat Chowdhary firstname.lastname@example.org wrote:
I am installed chef-solo using curl -L https://www.opscode.com/chef/install.sh | bash
But, When i am trying to create Roles and Environments, i am getting below error:
knife role create test ERROR: Your private key could not be loaded from /etc/chef/client.pem Check your configuration file and ensure that your private key is readable
As i am using chef-solo, i don’t have /etc/chef/client.pem (i guess this will be available in Chef server and client model).
And i think knife is not best option in chef-solo as most knife commands are basically wrappers around uploading and downloading data to/from a chef server (If i am correct).
So, Chef experts, could you please help/guide me how to create roles, environments and deployment using chef-solo.
Thanks in advance.
Thanks & Regards