Chef Server on AWS
Quick Start Reference Deployment Guide

Bootstrapping a Node

Next, you can use the knife command to bootstrap the node and execute the run-list for the node, which will contain the webserver cookbook.

  1. Since knife will use SSH to communicate with the node, you’ll need to provide your AWS private key. For example, if your private key is called MyKey, copy the MyKey.pem file to the c:\chef-repo\.chef folder. The .chef folder contains the .pem files for Chef Server as well, and the .gitignore file in your chef-repo excludes the .pem file from Git commit operations.

  2. You can now use the knife bootstrap command to bootstrap the node. Retrieve the private IP address for the Ubuntu Server tagged “NODE” in the Amazon EC2 console. Run the following command (replacing x.x.x.x with the private IP of your node, and mykey.pem with the name of your .pem file) to bootstrap the node and execute the run-list.


    The knife bootstrap command should be entered on one line in the ChefDK console. It’s broken up here for readability.

    knife bootstrap x.x.x.x --ssh-user ubuntu --sudo --identity-file ./.chef/mykey.pem --run-list webserver

    After executing the command you’ll see the node bootstrap, and the run-list will execute and configure the node as a web server. At that point, you can navigate to the node’s IP address in a web browser, where you will see a "hello world" message confirming that the configuration has been applied successfully.

                        Reviewing the Output when Bootstrapping the Node

    Figure 15: Reviewing the Output when Bootstrapping the Node

    You can configure the node to run chef-client on a regular basis to process future changes that you might make, such as modifying the cookbook, or customizing the run-list. To do so, schedule the chef-client to run at your desired interval via Cron.