简体   繁体   中英

Not able to create environments and roles using chef-solo and knife

I installed chef-solo using curl -L https://www.opscode.com/chef/install.sh | bash curl -L https://www.opscode.com/chef/install.sh | bash

But when I try to create roles and environments, I am getting the 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, can anyone tell me how to create roles, environments and deployment using chef-solo?

As stated in the documentation , this uploads a role to a chef server (as you have experienced).

For chef-solo, you just create the role files (usually in roles/ ) and chef-solo will pick them up (assuming your setup is correct, don't know, if you're using Vagrant, too).

You can create these role files either as JSON or in Ruby DSL (which I personally find more convenient). Here's more info how that files have to look like Roles: Role Formats .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM