The Knife Bootstrap scripts included with Chef by default are meant to be generalized, and implement instructions found for installing Chef clients.This means that they may not be perfect for your specific needs in their default state.If that is the case, you can modify them, or create your own custom scripts. The following are a couple of examples of creating custom scripts or bootstrap templates. Modifying the default script for ubuntu 10.04.Copy the bootstrap template from the default location. For example I installed Chef as a RubyGem, so I can get the full path of the file out of the gem contents: Copy the template to the Chef Repository in the .chef/bootstrap directory. Modify the template with your favorite editor, then use it with the -d or --distro option in the Knife Bootstrap or cloud computing plugin commands. Alternatively, an example bootstrap template can be found in the chef source repository. Copy the template to ~/.chef-repo/.chef/bootstrap/ubuntu10.04-apt.erb and modify to suit your environment. Create a bootstrap for Debian systems using APT packages.Example client config (/etc/chef/client.rb) with Hosted Chef as the Chef Server: As it says on Knife Bootstrap, The knife bootstrap sub-command looks in three locations for the template to use:
So, using the second location from the above, we'd first create .chef/bootstrap/ in your Chef Repository directory, then create the ERB template file. Edit the template to run the commands, set up the validation certificate and the client configuration file, and finally to run chef-client on completion with the given run list (-r option). The bootstrap template can be called with:
|
|
|

