What are my options in installing chef-client as service during bootstrap?


What is the best design if chef-client as service is required during bootstrapping. I understand how do it manually afterwards but I’m trying to figure out if it’s possible to do during bootstrap process itself. I’m surprised it’s not default installation option really since I think chef-client is ultimately needs to be run automatically in majority of environments either way.


I don’t know what the “best” way is, if there is such a thing, but Cloud-Init does it rather well, for example.

I would say the the easiest way would be to add a recipe to your default role added when you bootstrap that includes the chef-client::default recipe. That will set up your chef-client service

Have a look at the chef-client cookbook. It has a windows_service and also a task recipe for installing a windows service or scheduled task to run the chef-client. So if you have that at the beginning of your runlist then your client should run in a service/task on runs after the initial bootstrap.

I guess chef-client cookbook would help to fix your problem. and include that cookbook in the a role.