Skip to content

rrana/Cloud-Provisioner

Repository files navigation

Puppet Cloud Provisioner
========================

Puppet Module to launch and manage Cloud instances.

This module requires Puppet 2.7.2 or later.


Getting Started with Amazon EC2
===============================
Access Key ID and Access Key should be placed into the
~/.fog file with the following syntax:

    :default:
      :aws_access_key_id: AKIAIXXXXXXXXXXXXXXX
      :aws_secret_access_key: jcjnhaXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXX

Private key should also be placed at the --keyfile location


Finally, you'll probably want to configure the default EC2 security group to
allow SSH (Port 22) access.  This can be accomplished through the Amazon EC2
console.  The install actions will fail if they cannot access the target system
on port 22 (SSH).

Required Gems
=============

 * guid (>= 0.1.1)
 * fog (0.7.2)

Note, the rspec unit tests currently have problems with Fog 0.9.0, but the
command line actions themselves appear to work.  If you have problems with
Cloud Provisioner, please try the specific version of Fog.  You may install 0.7.2
using the following command:

    gem install fog -v 0.7.2 --no-ri --no-rdoc

AMI Image
---------

A Ubuntu based AMI in the East region with the [AWS Free Usage Tier][free tier] Amazon instances:

 * ami-06ad526f (US-East region) Ubuntu (Login: ubuntu)

Launching EC2 Instances
=======================

With your EC2 credentials placed in ~/.fog and your SSH private key available
on your system, you may launch a new instance with this module installed using
the following single command:

    $ puppet node create --image ami-2342a94a --keypair jeff --type t1.micro
    notice: Creating new instance ...
    notice: Creating new instance ... Done
    notice: Creating tags for instance ...
    notice: Creating tags for instance ... Done
    notice: Launching server i-e5c00f84 ...
    ##############
    notice: Server i-e5c00f84 is now launched
    notice: Server i-e5c00f84 public dns name: ec2-107-20-18-142.compute-1.amazonaws.com
    ec2-107-20-18-142.compute-1.amazonaws.com

Once launched, you should be able to SSH to the new system using the private
key associated with the keypair specified in the create action:

    $ ssh -i ~/.ssh/jeff.pem [email protected]
    RSA key fingerprint is a1:88:33:fa🇩🇪d7:7c:a8:84:ae:89:73:01:a2:2b:e8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'ec2-107-20-18-142.compute-1.amazonaws.com,107.20.18.142' (RSA) to the list of known hosts.
    [root@domU-12-31-39-07-8C-79 ~]# quit

Finally, you're able to install Puppet or Puppet Enterprise on the newly
launched system:

    $ puppet node install --login root --keyfile ~/.ssh/jeff.pem ec2-107-20-18-142.compute-1.amazonaws.com
    notice: Waiting for SSH response ...
    notice: Waiting for SSH response ... Done
    notice: Installing Puppet ...
    66421292-9dee-7f41-624e-6ad2c50d78c1

For more detailed information, please use the --verbose and --debug
options to get more detailed output from the command.

As we can see, this installs Puppet using ruby gems:

    $ ssh [email protected] puppet --version
    2.6.4

Puppet Installation
===================

The following installation scripts are available to install puppet on a target
system.  These script are appropriate values for the --install-script option to
the puppet node install action.

 * gems (default) - Installs Puppet and Facter from RubyGems.

 * puppet-enterprise - Installs Puppet by uploading a copy of the puppet
enterpise tarball from your workstation to the target node along with an
automated answers file.

 * puppet-enterprise-s3 - Installs Puppet by downloading a copy of Puppet
Enterprise 1.1 from Puppet Labs.  This may be much faster than the
puppet-enterprise script if you have limited upload bandwidth.

Building the Module
===================

The [Puppet Module Tool](https://github.com/puppetlabs/puppet-module-tool) may
be used to build an installable package of this Puppet Module.

    $ puppet-module build
    ==============================================================
    Building /Users/jeff/src/modules/cloud-provisioner for release
    --------------------------------------------------------------
    Done. Built: pkg/puppetlabs-cloud-provisioner-0.0.1git-95-g6541187.tar.gz

To install the packaged module:

    $ cd <modulepath> (usually /etc/puppet/modules)
    $ puppet-module install ~/src/modules/cloud-provisioner/pkg/puppetlabs-cloud-provisioner-0.0.1git-95-g6541187.tar.gz
    Installed "puppetlabs-cloud-provisioner-0.0.1git-95-g6541187.tar.gz" into directory: cloud-provisioner



About

Puppet Cloud Provisioner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages