We are in the process of bootstrapping a lot of servers but need a good way to add them to an environment. We are going to use SCCM for Windows and we have it working except for adding to environment. I believe I read some where you can add the environment to client.rb but not sure on the syntax. Also, is there a script that we can add to the package that runs on the node to add to an environment such as Dev?
Thanks for the response but that is fine if I want to bootstrap one at a time. Isn’t there a file I can specify the environment so I can add 100 servers to an environment at once.
I believe the only way to bootstrap multiple nodes at the same time is to run the bootstrap command in a LOOP.
you could do something like this:
for n in host1 host2 host3; do knife bootstrap $n -x -sudo -x user -r role[myapp]; done
To be a bit pedantic, other approaches are possible, but nothing is provided out of the box as the implementation must be a bit custom.
When bootstrapping a lot of nodes and you have an existing management tool like SCCM, you can use that tool to install Chef Client and follow a process similar to an unattended install.
The important bit for this discussion is the -j option to Chef Client, which provides initial node data for that system. There's more docs about that here: Chef Infra Client (executable) (scroll to -j). In particular, content like this: