libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r797827 - /websites/staging/libcloud/trunk/content/docs/compute-deployment.html
Date Tue, 01 Nov 2011 02:47:22 GMT
Author: buildbot
Date: Tue Nov  1 02:47:21 2011
New Revision: 797827

Log:
Staging update by buildbot

Modified:
    websites/staging/libcloud/trunk/content/docs/compute-deployment.html

Modified: websites/staging/libcloud/trunk/content/docs/compute-deployment.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/compute-deployment.html (original)
+++ websites/staging/libcloud/trunk/content/docs/compute-deployment.html Tue Nov  1 02:47:21
2011
@@ -65,7 +65,7 @@ fully started SSHing into the node and r
 <p>Keep in mind that Libcloud is not a replacement for a configuration management
 tool so it shouldn't be used as such.</p>
 <p><em>Note: Deployment functionality depends on the <code>paramiko</code>
library which can be installed using pip - <code>pip install paramiko</code>.</em></p>
-<h3 id="example_1_-_deploying_a_node_and_installing_your_ssh_key_and_puppet_on_it">Example
1 - Deploying a Node and installing your SSH key and Puppet on it</h3>
+<h3 id="example_1_-_deploying_a_rackspace_node_using_password_authentication_and_installing_your_ssh_key_and_puppet_on_it">Example
1 - Deploying a Rackspace Node using password authentication and installing your SSH key and
Puppet on it</h3>
 <div class="codehilite"><pre><span class="kn">from</span> <span
class="nn">libcloud.compute.types</span> <span class="kn">import</span>
<span class="n">Provider</span>
 <span class="kn">from</span> <span class="nn">libcloud.compute.providers</span>
<span class="kn">import</span> <span class="n">get_driver</span>
 <span class="kn">from</span> <span class="nn">libcloud.compute.deployment</span>
<span class="kn">import</span> <span class="n">MultiStepDeployment</span><span
class="p">,</span> <span class="n">ScriptDeployment</span><span class="p">,</span>
<span class="n">SSHKeyDeployment</span>
@@ -94,6 +94,39 @@ tool so it shouldn't be used as such.</p
 <span class="c"># &lt;Node: uuid=..., name=test, state=3, public_ip=[&#39;1.1.1.1&#39;],
provider=Rackspace ...&gt;</span>
 <span class="c"># the node is now booted, with your ssh key and puppet installed.</span>
 </pre></div>
+
+
+<h3 id="example_2_-_deploying_an_ec2_node_using_ssh_key_authentication_and_installing_puppet_on_it">Example
2 - Deploying an EC2 Node using SSH key authentication and installing Puppet on it</h3>
+<div class="codehilite"><pre><span class="kn">from</span> <span
class="nn">libcloud.compute.types</span> <span class="kn">import</span>
<span class="n">Provider</span>
+<span class="kn">from</span> <span class="nn">libcloud.compute.providers</span>
<span class="kn">import</span> <span class="n">get_driver</span>
+<span class="kn">from</span> <span class="nn">libcloud.compute.deployment</span>
<span class="kn">import</span> <span class="n">ScriptDeployment</span>
+
+<span class="n">EC2_ACCESS_ID</span> <span class="o">=</span> <span
class="s">&#39;your access key&#39;</span>
+<span class="n">EC2_SECRET</span> <span class="o">=</span> <span
class="s">&#39;your secret&#39;</span>
+
+<span class="n">Driver</span> <span class="o">=</span> <span class="n">get_driver</span><span
class="p">(</span><span class="n">Provider</span><span class="o">.</span><span
class="n">EC2_US_EAST</span><span class="p">)</span>
+<span class="n">conn</span> <span class="o">=</span> <span class="n">Driver</span><span
class="p">(</span><span class="n">EC2_ACCESS_ID</span><span class="p">,</span>
<span class="n">EC2_SECRET</span><span class="p">)</span>
+
+<span class="c"># a simple script to install puppet post boot, can be much more complicated.</span>
+<span class="n">script</span> <span class="o">=</span> <span class="n">ScriptDeployment</span><span
class="p">(</span><span class="s">&quot;apt-get -y install puppet&quot;</span><span
class="p">)</span>
+
+<span class="c"># Ubuntu 10.04</span>
+<span class="n">image</span> <span class="o">=</span> <span class="p">[</span><span
class="n">i</span> <span class="k">for</span> <span class="n">i</span>
<span class="ow">in</span> <span class="n">driver</span><span class="o">.</span><span
class="n">list_images</span><span class="p">()</span> <span class="k">if</span>
<span class="n">i</span><span class="o">.</span><span class="n">id</span>
<span class="o">==</span><span class="s">&#39;ami-09965860&#39;</span>
<span class="p">][</span><span class="mi">0</span><span class="p">]</span>
+<span class="n">size</span> <span class="o">=</span> <span class="p">[</span><span
class="n">s</span> <span class="k">for</span> <span class="n">s</span>
<span class="ow">in</span> <span class="n">driver</span><span class="o">.</span><span
class="n">list_sizes</span><span class="p">()</span> <span class="k">if</span>
<span class="n">s</span><span class="o">.</span><span class="n">id</span>
<span class="o">==</span> <span class="s">&#39;t1.micro&#39;</span><span
class="p">][</span><span class="mi">0</span><span class="p">]</span>
+
+<span class="c"># Name of the SSH key which is automatically installed on the server.</span>
+<span class="c"># Key needs to be generated and named in the AWS control panel.</span>
+<span class="n">key_name</span> <span class="o">=</span> <span
class="s">&#39;my_default&#39;</span>
+
+<span class="c"># Path to the private key created using the AWS control panel.</span>
+<span class="n">key_path</span> <span class="o">=</span> <span
class="s">&#39;/home/user/path/to/key.pem&#39;</span>
+
+<span class="c"># deploy_node takes the same base keyword arguments as create_node.</span>
+<span class="n">node</span> <span class="o">=</span> <span class="n">conn</span><span
class="o">.</span><span class="n">deploy_node</span><span class="p">(</span><span
class="n">name</span><span class="o">=</span><span class="s">&#39;test&#39;</span><span
class="p">,</span> <span class="n">image</span><span class="o">=</span><span
class="n">image</span><span class="p">,</span> <span class="n">size</span><span
class="o">=</span><span class="n">size</span><span class="p">,</span>
<span class="n">deploy</span><span class="o">=</span><span class="n">script</span><span
class="p">,</span>
+                        <span class="n">ssh_key</span><span class="o">=</span><span
class="n">key_path</span><span class="p">,</span> <span class="n">ex_keyname</span><span
class="o">=</span><span class="n">key_name</span><span class="p">)</span>
+<span class="c"># &lt;Node: uuid=..., name=test, state=3, public_ip=[&#39;1.1.1.1&#39;],
provider=EC2 ...&gt;</span>
+<span class="c"># the node is now booted, with puppet installed.</span>
+</pre></div>
       
     </div>
 



Mime
View raw message