Skip to content

clouds.rb (configuration)

fairchild edited this page Sep 13, 2010 · 2 revisions

PoolParty provides a DSL to describe cloud infrastructure from within a single file (or several files). The entire cloud architecture can be defined simply as:


  pool :interesting do
    cloud :awesome do
        keypair 'interesting_awesome'
    end
  end

PoolParty views the pieces of the infrastructure as decoupled components in the stack. Thus, usage is no more than choosing components of the stack. This is where the clouds.rb configuration file gets used.

Clouds.rb is the location for almost all configuration from within PoolParty (chef recipes are the exception to the rule here). The configuration is compiled and consumed by the cloud.

clouds.rb

The simplest cloud definition looks like:


  cloud :application_cloud do
      keypair 'keypair_name'
  end

This defines a cloud named :application_cloud with the PoolParty defaults. These defaults can be found in the file default.rb.

A more interesting cloud description would look like:


  pool: interesting_web_site_pool do
    cloud :application_cloud do

      using :ec2
      image_id "ami-abc123"      
      keypair "name_of_ec2_keypair" # or the full path to the keypair on the development machine
      instances 2..10

      enable :haproxy      

    end
  end

The above describes a cloud that uses ec2 as the remoter base. The ami is set as “ami-abc123.” Similarly, the keypair is set as the name_of_ec2_keypair. This can also be set as a full path to the keypair on the development machine.

This cloud defines the minimum number of instances as 2 and the maximum as 10. These can also be set as: maximum_instances and minimum_instances in the clouds.rb file.

Finally, this cloud uses the haproxy plugin (that is baked into the PoolParty base), which is enabled by calling “enable” with the name of the plugin. Haproxy can be disabled by calling: disable :haproxy. It is enabled by default.

Plugins

Plugins are containers of resources. An example of this can be viewed in the poolparty plugins.

Clone this wiki locally