Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
Thank you. I've used users cookbook for this. – astlock Apr 4 '13 at 9:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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