You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2013/09/26 04:47:05 UTC

svn commit: r1526359 - /incubator/jclouds/site-content/documentation/quickstart/chef/index.html

Author: nacx
Date: Thu Sep 26 02:47:05 2013
New Revision: 1526359

URL: http://svn.apache.org/r1526359
Log:
deploy jclouds site content

Modified:
    incubator/jclouds/site-content/documentation/quickstart/chef/index.html

Modified: incubator/jclouds/site-content/documentation/quickstart/chef/index.html
URL: http://svn.apache.org/viewvc/incubator/jclouds/site-content/documentation/quickstart/chef/index.html?rev=1526359&r1=1526358&r2=1526359&view=diff
==============================================================================
--- incubator/jclouds/site-content/documentation/quickstart/chef/index.html (original)
+++ incubator/jclouds/site-content/documentation/quickstart/chef/index.html Thu Sep 26 02:47:05 2013
@@ -52,23 +52,22 @@
 		<h1>Quick Start: Chef</h1>
 
 <ol>
-<li>Setup a Chef Server or register for <a href="https://community.opscode.com/users/new">Opscode Hosted Chef</a>.</li>
+<li>Setup a Chef Server or register for <a href="https://getchef.opscode.com/signup">Opscode Enterprise Chef</a>.</li>
 <li>Ensure you are using a recent JDK 6 version.</li>
-<li>Setup your project to include <code>chef</code>, <code>hostedchef</code> or <code>privatechef</code>, depending on the Chef flavor you are going to connect to.
+<li>Setup your project to include <code>chef</code>, or <code>enterprisechef</code>, depending on the Chef flavor you are going to connect to.
 
 <ul>
 <li>Get the dependencies <code>org.jclouds.api/chef</code> using jclouds <a href="/documentation/userguide/installation-guide">Installation</a>.</li>
-<li>Get the dependencies <code>org.jclouds.labs/hostedchef</code> using jclouds <a href="/documentation/userguide/installation-guide">Installation</a>.</li>
-<li>Get the dependencies <code>org.jclouds.labs/privatechef</code> using jclouds <a href="/documentation/userguide/installation-guide">Installation</a>.</li>
+<li>Get the dependencies <code>org.jclouds.provider/enterprisechef</code> using jclouds <a href="/documentation/userguide/installation-guide">Installation</a>.</li>
 </ul>
 </li>
 <li>Start coding</li>
 </ol>
 
 
-<h2>About Hosted and Private Chef</h2>
+<h2>About Enterprise Chef</h2>
 
-<p>The Hosted and Private Chef apis are still not complete. The User and Organization apis are still a work in progress, so please, be patient.<br/>
+<p>The Enterprise Chef api is still not complete. The User and Organization apis are still a work in progress, so please, be patient.
 The core Chef api, however, provides access to all Chef features in all Chef flavors, so you can use that api to connect to your favorite endpoint.</p>
 
 <h2>Using the Chef Server api</h2>
@@ -76,20 +75,20 @@ The core Chef api, however, provides acc
 <p>You can easily access the Chef Server api to manage the different components of your Chef Server.<br/>
 The following example shows several calls to the api and the creation of the context, so you can get an idea of how jclouds-chef works.</p>
 
-<p>Note that you can use <code>chef</code>, <code>hostedchef</code> or <code>privatechef</code> to create the context.</p>
+<p>Note that you can use <code>chef</code> or <code>enterprisechef</code> to create the context.</p>
 
 <div class="highlight"><pre><code class="java"><span class="n">String</span> <span class="n">client</span> <span class="o">=</span> <span class="s">&quot;clientName&quot;</span><span class="o">;</span>
 <span class="n">String</span> <span class="n">organization</span> <span class="o">=</span> <span class="s">&quot;organization&quot;</span>
 <span class="n">String</span> <span class="n">pemFile</span> <span class="o">=</span> <span class="n">System</span><span class="o">.</span><span class="na">getProperty</span><span class="o">(</span><span class="s">&quot;user.home&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s">&quot;/.chef/&quot;</span> <span class="o">+</span> <span class="n">client</span> <span class="o">+</span> <span class="s">&quot;.pem&quot;</span><span class="o">;</span>
 <span class="n">String</span> <span class="n">credential</span> <span class="o">=</span> <span class="n">Files</span><span class="o">.</span><span class="na">toString</span><span class="o">(</span><span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="n">pemFile</span><span class="o">),</span> <span class="n">Charsets</span><span class="o">.</span><span class="na">UTF_8</span><span class="o">);</span>
 
-<span class="n">ChefContext</span> <span class="n">context</span> <span class="o">=</span> <span class="n">ContextBuilder</span><span class="o">.</span><span class="na">newBuilder</span><span class="o">(</span><span class="s">&quot;hostedchef&quot;</span><span class="o">)</span> <span class="c1">//</span>
+<span class="n">ChefContext</span> <span class="n">context</span> <span class="o">=</span> <span class="n">ContextBuilder</span><span class="o">.</span><span class="na">newBuilder</span><span class="o">(</span><span class="s">&quot;enterprisechef&quot;</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">endpoint</span><span class="o">(</span><span class="s">&quot;https://api.opscode.com/organizations/&quot;</span> <span class="o">+</span> <span class="n">organization</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">credentials</span><span class="o">(</span><span class="n">client</span><span class="o">,</span> <span class="n">credential</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">buildView</span><span class="o">(</span><span class="n">ChefContext</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
 
 <span class="c1">// The raw api has access to all chef features, as exposed in the Chef REST api</span>
-<span class="n">HostedChefApi</span> <span class="n">api</span> <span class="o">=</span> <span class="n">context</span><span class="o">.</span><span class="na">getApi</span><span class="o">(</span><span class="n">HostedChefApi</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+<span class="n">EnterpriseChefApi</span> <span class="n">api</span> <span class="o">=</span> <span class="n">context</span><span class="o">.</span><span class="na">unwrapApi</span><span class="o">(</span><span class="n">EnterpriseChefApi</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
 <span class="n">Set</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">databags</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="na">listDatabags</span><span class="o">();</span>
 
 <span class="c1">// ChefService has helpers for common commands</span>
@@ -128,7 +127,7 @@ We also provide a couple of utilities to
 <span class="n">chefConfig</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">ChefProperties</span><span class="o">.</span><span class="na">CHEF_VALIDATOR_CREDENTIAL</span><span class="o">,</span> <span class="n">validatorCredential</span><span class="o">);</span>
 
 <span class="c1">// Create the connection to the Chef server</span>
-<span class="n">ChefContext</span> <span class="n">context</span> <span class="o">=</span> <span class="n">ContextBuilder</span><span class="o">.</span><span class="na">newBuilder</span><span class="o">(</span><span class="s">&quot;hostedchef&quot;</span><span class="o">)</span> <span class="c1">//</span>
+<span class="n">ChefContext</span> <span class="n">context</span> <span class="o">=</span> <span class="n">ContextBuilder</span><span class="o">.</span><span class="na">newBuilder</span><span class="o">(</span><span class="s">&quot;enterprisechef&quot;</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">endpoint</span><span class="o">(</span><span class="s">&quot;https://api.opscode.com/organizations/&quot;</span> <span class="o">+</span> <span class="n">organization</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">credentials</span><span class="o">(</span><span class="n">client</span><span class="o">,</span> <span class="n">credential</span><span class="o">)</span> <span class="c1">//</span>
     <span class="o">.</span><span class="na">overrides</span><span class="o">(</span><span class="n">chefConfig</span><span class="o">)</span> <span class="c1">//</span>
@@ -146,7 +145,7 @@ We also provide a couple of utilities to
 
 <span class="c1">// Set the recipe to install and the configuration values to override</span>
 <span class="n">String</span> <span class="n">recipe</span> <span class="o">=</span> <span class="s">&quot;apache2&quot;</span><span class="o">;</span>
-<span class="n">String</span> <span class="n">config</span> <span class="o">=</span> <span class="s">&quot;{\&quot;apache\&quot;: {\&quot;listen_ports\&quot;: \&quot;8080\&quot;}}&quot;</span><span class="o">;</span>
+<span class="n">String</span> <span class="n">attributes</span> <span class="o">=</span> <span class="s">&quot;{\&quot;apache\&quot;: {\&quot;listen_ports\&quot;: \&quot;8080\&quot;}}&quot;</span><span class="o">;</span>
 
 <span class="c1">// Check to see if the recipe you want exists</span>
 <span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">runlist</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
@@ -158,7 +157,8 @@ We also provide a couple of utilities to
 
 <span class="c1">// Update the chef service with the run list you wish to apply to all nodes in the group</span>
 <span class="c1">// and also provide the json configuration used to customize the desired values</span>
-<span class="n">chefContext</span><span class="o">.</span><span class="na">getChefService</span><span class="o">().</span><span class="na">updateBootstrapConfigForGroup</span><span class="o">(</span><span class="n">runlist</span><span class="o">,</span> <span class="k">new</span> <span class="n">JsonBall</span><span class="o">(</span><span class="n">config</span><span class="o">),</span> <span class="n">group</span><span class="o">);</span>
+<span class="n">BootstrapConfig</span> <span class="n">config</span> <span class="o">=</span> <span class="n">BootstrapConfig</span><span class="o">.</span><span class="na">builder</span><span class="o">().</span><span class="na">runList</span><span class="o">(</span><span class="n">runlist</span><span class="o">).</span><span class="na">attributes</span><span class="o">(</span><span class="n">attributes</span><span class="o">).</span><span class="na">build</span><span class="o">();</span>
+<span class="n">chefContext</span><span class="o">.</span><span class="na">getChefService</span><span class="o">().</span><span class="na">updateBootstrapConfigForGroup</span><span class="o">(</span><span class="n">group</span><span class="o">,</span> <span class="n">config</span><span class="o">);</span>
 
 <span class="c1">// Build the script that will bootstrap the node</span>
 <span class="n">Statement</span> <span class="n">bootstrap</span> <span class="o">=</span> <span class="n">chefContext</span><span class="o">.</span><span class="na">getChefService</span><span class="o">().</span><span class="na">createBootstrapScriptForGroup</span><span class="o">(</span><span class="n">group</span><span class="o">);</span>
@@ -183,7 +183,7 @@ Here is the overall process:</p>
 <li>Write a single shell script that does the following:
 
 <ol>
-<li>Installs Ruby and Chef Gems using the same process as <a href="http://wiki.opscode.com/display/chef/Knife+Bootstrap">Knife Bootstrap</a></li>
+<li>Installs Ruby and Chef Gems using the same process as <a href="http://docs.opscode.com/knife_bootstrap.html">Knife Bootstrap</a></li>
 <li>mkdir /etc/chef</li>
 <li>Write /etc/chef/client.rb, which sets the nodename as group-ip_address Ex. hadoop-175.2.2.3 (note that the ip address comes from ohai).</li>
 <li>Write /etc/chef/validation.pem associated with the provided validator.</li>
@@ -196,7 +196,11 @@ Here is the overall process:</p>
 
 <h2>Customize how Chef is installed</h2>
 
-<p>When bootstrapping nodes, jclouds will take care of installing all dependencies that are required to run Chef. This includes <code>ruby</code>, <code>rubygems</code> and the <code>chef</code> gem and its dependencies. Sometimes you may want to have more control over how those dependencies are installed, so starting from <code>jclouds 1.6.0-rc.1</code>, the following additional properties can be configured when creating the context:</p>
+<p>There are two different ways to install Chef: Using the Opscode Omnibus installer (<code>1.7</code> only), or manually installing the Chef gems.</p>
+
+<p>When using the Omnibus installer (the default option in jclouds <code>1.7</code>), the installer itself will download and install an entire Ruby and RubyGems distribution with the Chef gems preinstalled. All will be installed in an isolated directory so it does not affect any existing Ruby version. This is the preferred way to install Chef.</p>
+
+<p>If you need more control on what versions of Chef are installed, you can make jclouds install the appropriate gems. The following additional properties can be configured when creating the context to customize how Chef is installed:</p>
 
 <table>
 <thead>
@@ -207,6 +211,10 @@ Here is the overall process:</p>
 </thead>
 <tbody>
 <tr>
+<td> ChefProperties.USE_OMNIBUS </td>
+<td> Boolean property to enable/disable the Omnibus installer. By default is <code>true</code>.</td>
+</tr>
+<tr>
 <td> ChefProperties.CHEF_VERSION </td>
 <td> The version of the Chef gem to install. It accepts concrete versions, and also ranges like '>= 0.10.8', etc. If the property is not set, the latest available version of the gem will be installed.</td>
 </tr>