Contributors20 minutesRecall that any computer that's managed by a Chef server is called a node, and that chef-client is the command that applies the policy defined by your cookbooks to a node. We call the process that installs chef-client on a node and the initial check-in to the Chef server bootstrapping the node.
In this part you'll bootstrap your node and execute the learn_chef_apache2 cookbook on it.
1. Run the bootstrap command
knife bootstrap is the command you use to bootstrap a node. As part of the knife bootstrap command, you specify arguments depending on how you would normally connect to your node over SSH.
Key-based authentication is typically recommended over password authentication because it is more secure, but you can bootstrap your node using either method. If you're bootstrapping a local virtual machine, you may also have to specify the SSH forwarded port.
In each of the methods shown below, the --node-name argument uniquely identifies the node with the Chef server. Its value can be whatever you want. If you previously used the name node1-ubuntu to bootstrap a different node, you can respond with 'Y' to overwrite that node's entry on your Chef server. Alternatively, you can choose a different name or remove the previous node from your Chef server.
- If you're bootstrapping a Microsoft Azure instance
Later in this module, you'll use Chef's ability to search node metadata to run chef-client a second time on your node. That step will require your node to have an attribute that contains its public hostname or IP address.
Because Azure does not provide metadata about an instance's public hostname or IP address, you need to set it manually during the bootstrap process.
If you're using an Azure instance as your node, append the --json-attributes argument to the end of your knife bootstrap command in this format:
Terminal: ~/learn-chef
| --json-attributes '{"cloud": {"public_ip": "NODE_PUBLIC_IP_ADDRESS"}}'
|
For example:
Terminal: ~/learn-chef
| --json-attributes '{"cloud": {"public_ip": "13.82.139.157"}}'
|
If your workstation is running Windows, you need to run the bootstrap command differently.
Although we recommend that you run Chef commands from Chef Workstation command prompt, for this part we recommend that you use a standard PowerShell window. GitHub issue
From PowerShell, create a variable to hold the string as a JSON object.
Windows PowerShell: ~\learn-chef
PS > | $public_ip = '{"cloud": {"public_ip": "13.82.139.157"}}' | ConvertTo-Json
|
When you run the bootstrap command, pass the --json-attributes argument like this.
Windows PowerShell: ~\learn-chef
| --json-attributes $public_ip
|
Choose the option that matches how you normally connect to your node over SSH.
Bootstrap using key-based authentication
Replace ADDRESS with your remote node's external address, USER with your username, and IDENTITY_FILE with your SSH identify file, for example ~/.ssh/my.pem.
Terminal: ~/learn-chef
$ | knife bootstrap ADDRESS --ssh-user USER --sudo --identity-file IDENTITY_FILE --node-name node1-ubuntu --run-list 'recipe[learn_chef_apache2]'
|
Here's an example:
Terminal: ~/learn-chef
$ | knife bootstrap 192.168.145.131 --ssh-user vagrant --sudo --identity-file ~/.ssh/private_key --node-name node1-ubuntu --run-list 'recipe[learn_chef_apache2]'Creating new client for node1-ubuntuCreating new node for node1-ubuntuConnecting to 192.168.145.131192.168.145.131 -----> Installing Chef Omnibus (-v 13)192.168.145.131 downloading https://omnitruck-direct.chef.io/chef/install.sh192.168.145.131 to file /tmp/install.sh.2284/install.sh192.168.145.131 trying wget...192.168.145.131 ubuntu 14.04 x86_64192.168.145.131 Getting information for chef stable 13 for ubuntu...192.168.145.131 downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=13&p=ubuntu&pv=14.04&m=x86_64192.168.145.131 to file /tmp/install.sh.2288/metadata.txt192.168.145.131 trying wget...192.168.145.131 sha1 1ecb70effcf557dbac0d0de528bbef6937f9c581192.168.145.131 sha256 ce0ff3baf39c8c13ed474104928e7e4568a4997a1d5797cae2b2ba3ee001e3a8192.168.145.131 url https://packages.chef.io/files/stable/chef/13.8.5/ubuntu/14.04/chef_13.8.5-1_amd64.deb192.168.145.131 version 13.8.5192.168.145.131 downloaded metadata file looks valid...192.168.145.131 downloading https://packages.chef.io/files/stable/chef/13.8.5/ubuntu/14.04/chef_13.8.5-1_amd64.deb192.168.145.131 to file /tmp/install.sh.2288/chef_13.8.5-1_amd64.deb192.168.145.131 trying wget...192.168.145.131 Comparing checksum with sha256sum...192.168.145.131 Installing chef 13192.168.145.131 installing with dpkg...192.168.145.131 Selecting previously unselected package chef.192.168.145.131 Preparing to unpack .../chef_13.8.5-1_amd64.deb ...192.168.145.131 Unpacking chef (13.8.5-1) ...192.168.145.131 Setting up chef (13.8.5-1) ...192.168.145.131 Thank you for installing Chef!192.168.145.131 Starting the first Chef Client run...192.168.145.131 Starting Chef Client, version 13.8.5192.168.145.131 resolving cookbooks for run list: ["learn_chef_apache2"]192.168.145.131 Synchronizing Cookbooks:192.168.145.131 - learn_chef_apache2 (0.1.0)192.168.145.131 Installing Cookbook Gems:192.168.145.131 Compiling Cookbooks...192.168.145.131 Converging 4 resources192.168.145.131 Recipe: learn_chef_apache2::default192.168.145.131 * apt_update[Update the apt cache daily] action periodic192.168.145.131 - update new lists of packages192.168.145.131 * directory[/var/lib/apt/periodic] action create (up to date)192.168.145.131 * directory[/etc/apt/apt.conf.d] action create (up to date)192.168.145.131 * file[/etc/apt/apt.conf.d/15update-stamp] action create_if_missing (up to date)192.168.145.131 * execute[apt-get -q update] action run192.168.145.131 - execute apt-get -q update192.168.145.131 192.168.145.131 * apt_package[apache2] action install192.168.145.131 - install version 2.4.7-1ubuntu4.20 of package apache2192.168.145.131 * service[apache2] action enable (up to date)192.168.145.131 * service[apache2] action start (up to date)192.168.145.131 * template[/var/www/html/index.html] action create192.168.145.131 - update content in file /var/www/html/index.html from 538f31 to ef4ffd192.168.145.131 --- /var/www/html/index.html 2018-05-01 21:21:03.793548605 +0000192.168.145.131 +++ /var/www/html/.chef-index20180501-2376-ur8amo.html 2018-05-01 21:21:06.544722898 +0000192.168.145.131 @@ -1,379 +1,6 @@192.168.145.131 -192.168.145.131 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">192.168.145.131 -<html xmlns="http://www.w3.org/1999/xhtml">192.168.145.131 - <!--192.168.145.131 - Modified from the Debian original for Ubuntu192.168.145.131 - Last updated: 2014-03-19192.168.145.131 - See: https://launchpad.net/bugs/1288690192.168.145.131 - -->192.168.145.131 - <head>192.168.145.131 - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />192.168.145.131 - <title>Apache2 Ubuntu Default Page: It works</title>192.168.145.131 - <style type="text/css" media="screen">192.168.145.131 - * {192.168.145.131 - margin: 0px 0px 0px 0px;192.168.145.131 - padding: 0px 0px 0px 0px;192.168.145.131 - }192.168.145.131 -192.168.145.131 - body, html {192.168.145.131 - padding: 3px 3px 3px 3px;192.168.145.131 -192.168.145.131 - background-color: #D8DBE2;192.168.145.131 -192.168.145.131 - font-family: Verdana, sans-serif;192.168.145.131 - font-size: 11pt;192.168.145.131 - text-align: center;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.main_page {192.168.145.131 - position: relative;192.168.145.131 - display: table;192.168.145.131 -192.168.145.131 - width: 800px;192.168.145.131 -192.168.145.131 - margin-bottom: 3px;192.168.145.131 - margin-left: auto;192.168.145.131 - margin-right: auto;192.168.145.131 - padding: 0px 0px 0px 0px;192.168.145.131 -192.168.145.131 - border-width: 2px;192.168.145.131 - border-color: #212738;192.168.145.131 - border-style: solid;192.168.145.131 -192.168.145.131 - background-color: #FFFFFF;192.168.145.131 -192.168.145.131 - text-align: center;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.page_header {192.168.145.131 - height: 99px;192.168.145.131 - width: 100%;192.168.145.131 -192.168.145.131 - background-color: #F5F6F7;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.page_header span {192.168.145.131 - margin: 15px 0px 0px 50px;192.168.145.131 -192.168.145.131 - font-size: 180%;192.168.145.131 - font-weight: bold;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.page_header img {192.168.145.131 - margin: 3px 0px 0px 40px;192.168.145.131 -192.168.145.131 - border: 0px 0px 0px;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents {192.168.145.131 - clear: left;192.168.145.131 -192.168.145.131 - min-width: 200px;192.168.145.131 -192.168.145.131 - margin: 3px 3px 3px 3px;192.168.145.131 -192.168.145.131 - background-color: #FFFFFF;192.168.145.131 -192.168.145.131 - text-align: left;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents_item {192.168.145.131 - clear: left;192.168.145.131 -192.168.145.131 - width: 100%;192.168.145.131 -192.168.145.131 - margin: 4px 0px 0px 0px;192.168.145.131 -192.168.145.131 - background-color: #FFFFFF;192.168.145.131 -192.168.145.131 - color: #000000;192.168.145.131 - text-align: left;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents_item a {192.168.145.131 - margin: 6px 0px 0px 6px;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section {192.168.145.131 - margin: 3px 3px 3px 3px;192.168.145.131 -192.168.145.131 - background-color: #FFFFFF;192.168.145.131 -192.168.145.131 - text-align: left;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text {192.168.145.131 - padding: 4px 8px 4px 8px;192.168.145.131 -192.168.145.131 - color: #000000;192.168.145.131 - font-size: 100%;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text pre {192.168.145.131 - margin: 8px 0px 8px 0px;192.168.145.131 - padding: 8px 8px 8px 8px;192.168.145.131 -192.168.145.131 - border-width: 1px;192.168.145.131 - border-style: dotted;192.168.145.131 - border-color: #000000;192.168.145.131 -192.168.145.131 - background-color: #F5F6F7;192.168.145.131 -192.168.145.131 - font-style: italic;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text p {192.168.145.131 - margin-bottom: 6px;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text ul, div.content_section_text li {192.168.145.131 - padding: 4px 8px 4px 16px;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.section_header {192.168.145.131 - padding: 3px 6px 3px 6px;192.168.145.131 -192.168.145.131 - background-color: #8E9CB2;192.168.145.131 -192.168.145.131 - color: #FFFFFF;192.168.145.131 - font-weight: bold;192.168.145.131 - font-size: 112%;192.168.145.131 - text-align: center;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.section_header_red {192.168.145.131 - background-color: #CD214F;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.section_header_grey {192.168.145.131 - background-color: #9F9386;192.168.145.131 - }192.168.145.131 -192.168.145.131 - .floating_element {192.168.145.131 - position: relative;192.168.145.131 - float: left;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents_item a,192.168.145.131 - div.content_section_text a {192.168.145.131 - text-decoration: none;192.168.145.131 - font-weight: bold;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents_item a:link,192.168.145.131 - div.table_of_contents_item a:visited,192.168.145.131 - div.table_of_contents_item a:active {192.168.145.131 - color: #000000;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.table_of_contents_item a:hover {192.168.145.131 - background-color: #000000;192.168.145.131 -192.168.145.131 - color: #FFFFFF;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text a:link,192.168.145.131 - div.content_section_text a:visited,192.168.145.131 - div.content_section_text a:active {192.168.145.131 - background-color: #DCDFE6;192.168.145.131 -192.168.145.131 - color: #000000;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.content_section_text a:hover {192.168.145.131 - background-color: #000000;192.168.145.131 -192.168.145.131 - color: #DCDFE6;192.168.145.131 - }192.168.145.131 -192.168.145.131 - div.validator {192.168.145.131 - }192.168.145.131 - </style>192.168.145.131 - </head>192.168.145.131 +<html>192.168.145.131 <body>192.168.145.131 - <div class="main_page">192.168.145.131 - <div class="page_header floating_element">192.168.145.131 - <img src="/icons/ubuntu-logo.png" alt="Ubuntu Logo" class="floating_element"/>192.168.145.131 - <span class="floating_element">192.168.145.131 - Apache2 Ubuntu Default Page192.168.145.131 - </span>192.168.145.131 - </div>192.168.145.131 -<!-- <div class="table_of_contents floating_element">192.168.145.131 - <div class="section_header section_header_grey">192.168.145.131 - TABLE OF CONTENTS192.168.145.131 - </div>192.168.145.131 - <div class="table_of_contents_item floating_element">192.168.145.131 - <a href="#about">About</a>192.168.145.131 - </div>192.168.145.131 - <div class="table_of_contents_item floating_element">192.168.145.131 - <a href="#changes">Changes</a>192.168.145.131 - </div>192.168.145.131 - <div class="table_of_contents_item floating_element">192.168.145.131 - <a href="#scope">Scope</a>192.168.145.131 - </div>192.168.145.131 - <div class="table_of_contents_item floating_element">192.168.145.131 - <a href="#files">Config files</a>192.168.145.131 - </div>192.168.145.131 - </div>192.168.145.131 --->192.168.145.131 - <div class="content_section floating_element">192.168.145.131 -192.168.145.131 -192.168.145.131 - <div class="section_header section_header_red">192.168.145.131 - <div id="about"></div>192.168.145.131 - It works!192.168.145.131 - </div>192.168.145.131 - <div class="content_section_text">192.168.145.131 - <p>192.168.145.131 - This is the default welcome page used to test the correct 192.168.145.131 - operation of the Apache2 server after installation on Ubuntu systems.192.168.145.131 - It is based on the equivalent page on Debian, from which the Ubuntu Apache192.168.145.131 - packaging is derived.192.168.145.131 - If you can read this page, it means that the Apache HTTP server installed at192.168.145.131 - this site is working properly. You should <b>replace this file</b> (located at192.168.145.131 - <tt>/var/www/html/index.html</tt>) before continuing to operate your HTTP server.192.168.145.131 - </p>192.168.145.131 -192.168.145.131 -192.168.145.131 - <p>192.168.145.131 - If you are a normal user of this web site and don't know what this page is192.168.145.131 - about, this probably means that the site is currently unavailable due to192.168.145.131 - maintenance.192.168.145.131 - If the problem persists, please contact the site's administrator.192.168.145.131 - </p>192.168.145.131 -192.168.145.131 - </div>192.168.145.131 - <div class="section_header">192.168.145.131 - <div id="changes"></div>192.168.145.131 - Configuration Overview192.168.145.131 - </div>192.168.145.131 - <div class="content_section_text">192.168.145.131 - <p>192.168.145.131 - Ubuntu's Apache2 default configuration is different from the192.168.145.131 - upstream default configuration, and split into several files optimized for192.168.145.131 - interaction with Ubuntu tools. The configuration system is192.168.145.131 - <b>fully documented in192.168.145.131 - /usr/share/doc/apache2/README.Debian.gz</b>. Refer to this for the full192.168.145.131 - documentation. Documentation for the web server itself can be192.168.145.131 - found by accessing the <a href="/manual">manual</a> if the <tt>apache2-doc</tt>192.168.145.131 - package was installed on this server.192.168.145.131 -192.168.145.131 - </p>192.168.145.131 - <p>192.168.145.131 - The configuration layout for an Apache2 web server installation on Ubuntu systems is as follows:192.168.145.131 - </p>192.168.145.131 - <pre>192.168.145.131 -/etc/apache2/192.168.145.131 -|-- apache2.conf192.168.145.131 -| `-- ports.conf192.168.145.131 -|-- mods-enabled192.168.145.131 -| |-- *.load192.168.145.131 -| `-- *.conf192.168.145.131 -|-- conf-enabled192.168.145.131 -| `-- *.conf192.168.145.131 -|-- sites-enabled192.168.145.131 -| `-- *.conf192.168.145.131 - </pre>192.168.145.131 - <ul>192.168.145.131 - <li>192.168.145.131 - <tt>apache2.conf</tt> is the main configuration192.168.145.131 - file. It puts the pieces together by including all remaining configuration192.168.145.131 - files when starting up the web server.192.168.145.131 - </li>192.168.145.131 -192.168.145.131 - <li>192.168.145.131 - <tt>ports.conf</tt> is always included from the192.168.145.131 - main configuration file. It is used to determine the listening ports for192.168.145.131 - incoming connections, and this file can be customized anytime.192.168.145.131 - </li>192.168.145.131 -192.168.145.131 - <li>192.168.145.131 - Configuration files in the <tt>mods-enabled/</tt>,192.168.145.131 - <tt>conf-enabled/</tt> and <tt>sites-enabled/</tt> directories contain192.168.145.131 - particular configuration snippets which manage modules, global configuration192.168.145.131 - fragments, or virtual host configurations, respectively.192.168.145.131 - </li>192.168.145.131 -192.168.145.131 - <li>192.168.145.131 - They are activated by symlinking available192.168.145.131 - configuration files from their respective192.168.145.131 - *-available/ counterparts. These should be managed192.168.145.131 - by using our helpers192.168.145.131 - <tt>192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2enmod">a2enmod</a>,192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2dismod">a2dismod</a>,192.168.145.131 - </tt>192.168.145.131 - <tt>192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2ensite">a2ensite</a>,192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2dissite">a2dissite</a>,192.168.145.131 - </tt>192.168.145.131 - and192.168.145.131 - <tt>192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2enconf">a2enconf</a>,192.168.145.131 - <a href="http://manpages.debian.org/cgi-bin/man.cgi?query=a2disconf">a2disconf</a>192.168.145.131 - </tt>. See their respective man pages for detailed information.192.168.145.131 - </li>192.168.145.131 -192.168.145.131 - <li>192.168.145.131 - The binary is called apache2. Due to the use of192.168.145.131 - environment variables, in the default configuration, apache2 needs to be192.168.145.131 - started/stopped with <tt>/etc/init.d/apache2</tt> or <tt>apache2ctl</tt>.192.168.145.131 - <b>Calling <tt>/usr/bin/apache2</tt> directly will not work</b> with the192.168.145.131 - default configuration.192.168.145.131 - </li>192.168.145.131 - </ul>192.168.145.131 - </div>192.168.145.131 -192.168.145.131 - <div class="section_header">192.168.145.131 - <div id="docroot"></div>192.168.145.131 - Document Roots192.168.145.131 - </div>192.168.145.131 -192.168.145.131 - <div class="content_section_text">192.168.145.131 - <p>192.168.145.131 - By default, Ubuntu does not allow access through the web browser to192.168.145.131 - <em>any</em> file apart of those located in <tt>/var/www</tt>,192.168.145.131 - <a href="http://httpd.apache.org/docs/2.4/mod/mod_userdir.html">public_html</a>192.168.145.131 - directories (when enabled) and <tt>/usr/share</tt> (for web192.168.145.131 - applications). If your site is using a web document root192.168.145.131 - located elsewhere (such as in <tt>/srv</tt>) you may need to whitelist your192.168.145.131 - document root directory in <tt>/etc/apache2/apache2.conf</tt>.192.168.145.131 - </p>192.168.145.131 - <p>192.168.145.131 - The default Ubuntu document root is <tt>/var/www/html</tt>. You192.168.145.131 - can make your own virtual hosts under /var/www. This is different192.168.145.131 - to previous releases which provides better security out of the box.192.168.145.131 - </p>192.168.145.131 - </div>192.168.145.131 -192.168.145.131 - <div class="section_header">192.168.145.131 - <div id="bugs"></div>192.168.145.131 - Reporting Problems192.168.145.131 - </div>192.168.145.131 - <div class="content_section_text">192.168.145.131 - <p>192.168.145.131 - Please use the <tt>ubuntu-bug</tt> tool to report bugs in the192.168.145.131 - Apache2 package with Ubuntu. However, check <a192.168.145.131 - href="https://bugs.launchpad.net/ubuntu/+source/apache2">existing192.168.145.131 - bug reports</a> before reporting a new bug.192.168.145.131 - </p>192.168.145.131 - <p>192.168.145.131 - Please report bugs specific to modules (such as PHP and others)192.168.145.131 - to respective packages, not to the web server itself.192.168.145.131 - </p>192.168.145.131 - </div>192.168.145.131 -192.168.145.131 -192.168.145.131 -192.168.145.131 -192.168.145.131 - </div>192.168.145.131 - </div>192.168.145.131 - <div class="validator">192.168.145.131 - <p>192.168.145.131 - <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>192.168.145.131 - </p>192.168.145.131 - </div>192.168.145.131 + <h1>hello world</h1>192.168.145.131 </body>192.168.145.131 </html>192.168.145.131 -192.168.145.131 192.168.145.131 Running handlers:192.168.145.131 Running handlers complete192.168.145.131 Chef Client finished, 4/9 resources updated in 28 seconds
|
Bootstrap using password authentication
Replace ADDRESS with your remote node's external address, USER with your username, and PASSWORD with your user's password.
Terminal: ~/learn-chef
$ | knife bootstrap ADDRESS --ssh-user USER --ssh-password 'PASSWORD' --sudo --use-sudo-password --node-name node1-ubuntu --run-list 'recipe[learn_chef_apache2]'
|
The output will resemble the output shown for key-based authentication above.
Bootstrap a local virtual machine using a forwarded port
Replace PORT with your SSH forwarded port, for example, 2222, and IDENTITY_FILE with your SSH identify file, for example /home/user/.vagrant/machines/default/virtualbox/private_key.
Terminal: ~/learn-chef
$ | knife bootstrap localhost --ssh-port PORT --ssh-user vagrant --sudo --identity-file IDENTITY_FILE --node-name node1-ubuntu --run-list 'recipe[learn_chef_apache2]'
|
The output will resemble the output shown for key-based authentication above.
- Troubleshooting
If the operation times out or fails, here are some things to try.
- Ensure that you run
knife commands from your learn-chef directory or one of its sub-directories. - Ensure you have a
learn-chef/.chef directory and that it contains a knife.rb file and your RSA private key file. - Ensure that your node's IP address is accessible from your network.
- Ensure the user name you provide has root or
sudo access on the node. - Ensure your node provides network access on these ports:
- 22 (SSH)
- 80 (HTTP)
- 443 (HTTPS)
- The bootstrap process in detail
You can review the documentation to better understand the role of each knife bootstrap option. Here are the options that you used:
General options
--ssh-user--sudo--node-name--run-list
Options specific to key-based authentication
Options specific to password authentication
--ssh-password--use-sudo-password
Options specific to SSH forwarded port
--ssh-port--identity-file
You can also watch What happens during knife bootstrap to further understand the process.
2. Confirm the result
Two things just happened.
First, your node was associated with your Chef server. To verify this, run the knife node list command.
Terminal: ~/learn-chef
$ | knife node listnode1-ubuntunode1-windows
|
You can use the knife node show command to view data about your node.
Terminal: ~/learn-chef
$ | knife node show node1-ubuntuNode Name: node1-ubuntuEnvironment: _defaultFQDN: node1-ubuntuIP: 192.168.145.131Run List: recipe[learn_chef_apache2]Roles: Recipes: learn_chef_apache2, learn_chef_apache2::defaultPlatform: ubuntu 14.04Tags:
|
The second thing that happened was that your node did an initial check-in with the Chef server and ran the learn_chef_apache2 cookbook. That's because you specifed learn_chef_apache2 as the --run-list argument.
To verify the configuration, run curl. Replace the IP address you see here with yours.
Terminal: ~/learn-chef
$ | curl 192.168.145.131<html> <body> <h1>hello world</h1> </body></html>
|
You can also open a web browser from your workstation and navigate to your web server.

If you bootstrapped a Vagrant instance, an easy way to verify the configuration is to create an SSH connection to the instance and run curl localhost.
Terminal: ~
$ | vagrant sshLast login: Thu Dec 3 17:17:26 2015 from 10.0.2.2[vagrant@localhost ~]$ curl localhost <html> <body> <h1>hello world</h1> </body></html>[vagrant@localhost ~]$ exit logoutConnection to 127.0.0.1 closed.
|