Using Data Bags to store hostnames to bootstrap

Hi everyone,

I try to create a cookbook to bootstrap a bunch of new clients.

My idea is that I could use a linux node with ChefDK to bootstap new clients via knife.
All Hostnames will be stored in a DataBag.

I created a DataBag called ‘Hostnames’ with 2 Items ‘Windows’ and ‘Linux’ and I add the following JSON code for each system:



Is this a way to do this?
How can I get access to this Sublayer in the Databag?

I’d probably start by looking into accessing a data bag from chef-provisioning.

Alternatively you could write a knife exec script: There’s an example of accessing data bags in such a script here: Then you could loop that data into the bootstrap class? It’d be rather custom, of course.

I’m definitely recommend using ansible for bootstrap purpose. Something like this