I started to use Chef in my infrastructure, but cannot make recipe like this:

-each developer has own public ssh-key.

-in remote server there is an unique user, named ubuntu

I want to use data bags with users, like data_bags/users/jeff.json, data_bags/users/aaron.json, etc.

Create user ubuntu and keys from these users need to upload to ubuntu(authorized_keys) in the remote system, and delete from there if I deleted it from data_bags/users.

Are the standard cookbook users permit this? I'll be grateful if you provide an example or as any help.


The standard users cookbook manages keys of each user, with no option to look-up keys from other users in the data bag. You can use the "search" API in chef to gather all keys from data bag users and append these to your user of choice. See example in the standard users cookbook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.