Ashutosh Jha
Ashutosh Jha

Reputation: 33

How to pass a custom data bag while bootstrapping a node in chef?

I am using Chef12 to mange Users and SSH keys. I have followed this tutorial: https://blog.chef.io/2014/07/10/managing-users-and-ssh-keys-in-a-hybrid-world/

It worked fine.

Now problem is , user cookbook which was used in this process by default it takes data bag named users.

I have a data bag named users but this time i want to a different set of users which is in a different data bag.

But it takes only data bag name "users".

How can i pass this data bag to be used while bootstrapping a node?

Upvotes: 0

Views: 159

Answers (1)

Draco Ater
Draco Ater

Reputation: 21226

If you check the README in the users cookbook, you will see that you can provide data_bag parameter to the user_manage resource.

users_manage 'GROUPNAME' do
  group_id GROUPID
  action [:create]
  data_bag 'DATABAG_NAME'
end

Upvotes: 1

Related Questions