udit
udit

Reputation: 2783

Missing Private key error when creating Encrypted Data Bag with Knife

I'm trying to create an encrypted Data bag to store a Mysql password and followed the instructions here to run this command:

knife data bag create --secret-file /tmp/my_data_bag_key passwords mysql

This returns an error:

Error: "Your private key could not be loaded from /Users/ClientName/.chef/ClientName.pem" Check your configuration file and ensure that your private key is readable

Now there is no .pem file at that location.But do I really need one? For Chef solo? If I do, then how do I create this file?

Upvotes: 3

Views: 1687

Answers (2)

udit
udit

Reputation: 2783

The gist of it is that the Opscode links in the original post that point to Encrypted Data Bag creation instructions will not work for Chef-solo. The way to make Encrypted Data Bags work with Chef-solo is described here.

Upvotes: 2

turtlebender
turtlebender

Reputation: 1907

This command works by connecting to a chef server. If you don't have a key, this will fail. However, this knife plugin seems to do what you are looking for:

https://github.com/cparedes/knife-file

N.B., I have not used this plugin, but it looks right to me

Upvotes: 2

Related Questions