amazon-web-serviceschef-infraknifedatabagschef-vault

How to add node to list of clients that can access a data bag on a Chef Server?


I want/need one of my nodes to access a data bag on my chef server. The purpose is to get a decrypted ssh key so i can clone from a private repo. I've been trying many variations of

knife vault update data_bag item -A 'name-of-node'

But I do not see the node come up on the list of clients with access.

What am I doing wrong in this command or need to do to get this to work? I've been following this guide, but I'm not using roles.


Solution

  • Figured out that this command works for updating, but it basically adds all nodes and users. Would prefer a more precise answer for just an individual node if someone has one.

    knife vault update data_bag item --search '*:*' --admins me --mode client
    

    https://github.com/chef/chef-vault/issues/181

    https://github.com/chef/chef-vault/blob/master/THEORY.md

    EDIT:

    As the user in the comments mentioned, this too works and is more correct.

    knife vault create data_bag item '{"itemname":"securepass"}' --search 'name:my-node-name' --admins me --mode client