Charm: drupal
Summary
Drupal site
Charm Store
juju deploy cs:~mark-mims/oneiric/drupal-0
Owner
mark-mims
Series
oneiric
Description
Installs a Drupal site. Upon the database provider providing the required database, and the relation settings necessary to access it, completes the configuration of Drupal and makes it available on the web.
Links
Repository   Bugs
lp:~mark-mims/charms/oneiric/drupal/trunk
Interfaces
Provides
Requires
Readme
# Redirect

This is maintained on launchpad until I can get a bridge working.
Please see `lp:~mark-mims/principia/oneiric/drupal/trunk`


# Principia Drupal

This is an Ensemble formula for Drupal.

Find out more about [Ensemble](http://ensemble.ubuntu.com/).


# Installation

## Setup a formula repository

Create a formula repository called `principia` and clone this repo into it:

    $ mkdir principia
    $ cd principia
    $ git clone git@github.com:mmm/principia-drupal.git drupal
    $ cd ..

## get the principia mysql formula

Pull the principia mysql formula

    $ cd principia
    $ bzr branch lp:~ensemble-composers/principia/oneiric/mysql/trunk mysql
    $ cd ..


# Usage

## Use ensemble to deploy

### bootstrap

    $ ensemble bootstrap
    2011-06-01 19:57:50,219 INFO Bootstrapping environment 'sample' (type: ec2)
    2011-06-01 19:58:02,297 INFO 'bootstrap' command finished successfully


### start `mysql` and `drupal`

wait a minute or so to let EC2 catch up

    $ ensemble deploy --repository=principia mysql
    2011-06-01 20:01:03,265 INFO Connecting to environment.
    2011-06-01 20:01:11,617 INFO Formula deployed as service: 'mysql'
    2011-06-01 20:01:11,619 INFO 'deploy' command finished successfully

wait a minute or so to let EC2 catch up

    $ ensemble deploy --repository=principia drupal
    2011-06-01 20:01:17,186 INFO Connecting to environment.
    2011-06-01 20:01:25,228 INFO Formula deployed as service: 'drupal'
    2011-06-01 20:01:25,254 INFO 'deploy' command finished successfully

wait a minute or so to let EC2 catch up

    $ ensemble status
    2011-06-01 20:06:36,383 INFO Connecting to environment.
    machines:
      0: {dns-name: ec2-75-101-228-56.compute-1.amazonaws.com, instance-id: i-4507b52b}
      1: {dns-name: ec2-50-19-2-206.compute-1.amazonaws.com, instance-id: i-7108ba1f}
      2: {dns-name: ec2-174-129-114-51.compute-1.amazonaws.com, instance-id: i-ed08ba83}
    services:
      drupal:
        formula: local:drupal-201105311725
        relations: {}
        units:
          drupal/0:
            machine: 2
            relations: {}
            state: started

      mysql:
        formula: local:mysql-81
        relations: {}
        units:
          mysql/0:
            machine: 1
            relations: {}
            state: started
    2011-06-01 20:06:44,037 INFO 'status' command finished successfully

### Connect the two services

Once both the `mysql` and the `drupal` services both show a `started` status,
add the relation between the two to activate and couple the services.

    $ ensemble add-relation mysql drupal
    2011-06-01 20:13:15,326 INFO Connecting to environment.
    2011-06-01 20:13:21,644 INFO Added mysql relation to all service units.
    2011-06-01 20:13:21,645 INFO 'add_relation' command finished successfully
 
now status should show

    $ ensemble status
    2011-06-01 20:15:53,648 INFO Connecting to environment.
    machines:
      0: {dns-name: ec2-75-101-228-56.compute-1.amazonaws.com, instance-id: i-4507b52b}
      1: {dns-name: ec2-50-19-2-206.compute-1.amazonaws.com, instance-id: i-7108ba1f}
      2: {dns-name: ec2-174-129-114-51.compute-1.amazonaws.com, instance-id: i-ed08ba83}
    services:
      drupal:
        formula: local:drupal-201105311725
        relations: {db: mysql}
        units:
          drupal/0:
            machine: 2
            relations:
              db: {state: up}
            state: started
      mysql:
        formula: local:mysql-81
        relations: {db: drupal}
        units:
          mysql/0:
            machine: 1
            relations:
              db: {state: up}
            state: started
    2011-06-01 20:16:06,405 INFO 'status' command finished successfully



## Find the drupal instance's address

`ensemble status` tells you which instance drupal is installed on.  In the above example, drupal is installed on machine `2` or `ec2-174-129-114-51.compute-1.amazonaws.com`.

## Open in a browser to complete the Drupal install

Open a browser to

    http://<drupal instance address>/drupal6/install.php

In the above example, this would look like

    http://ec2-174-129-114-51.compute-1.amazonaws.com/drupal6/install.php



# More Instances - Rinse and Repeat
 
Scale out your drupal service by adding more units to your ensemble.

Start with a working drupal service that's already been related to a mysql service
as in the example above.
Then
 
    $ ensemble add-unit drupal
 
will add another drupal instance and relate it to the common mysql service.

Then status shows

    $ ensemble status
    2011-06-01 20:34:13,698 INFO Connecting to environment.
    machines:
      0: {dns-name: ec2-75-101-228-56.compute-1.amazonaws.com, instance-id: i-4507b52b}
      1: {dns-name: ec2-50-19-2-206.compute-1.amazonaws.com, instance-id: i-7108ba1f}
      2: {dns-name: ec2-174-129-114-51.compute-1.amazonaws.com, instance-id: i-ed08ba83}
      3: {dns-name: ec2-75-101-203-234.compute-1.amazonaws.com, instance-id: i-d3e855bd}
    services:
      drupal:
        formula: local:drupal-201105311725
        relations: {db: mysql}
        units:
          drupal/0:
            machine: 2
            relations:
              db: {state: up}
            state: started
          drupal/1:
            machine: 3
            relations:
              db: {state: up}
            state: started
      mysql:
        formula: local:mysql-81
        relations: {db: drupal}
        units:
          mysql/0:
            machine: 1
            relations:
              db: {state: up}
            state: started
    2011-06-01 20:34:18,358 INFO 'status' command finished successfully

Now connect to the new drupal unit in a browser

    http://ec2-75-101-203-234.compute-1.amazonaws.com/drupal6

and you see the same content created in the first one.

Changes  
2011/07/10 mmm redirect (revno 21)
2011/07/08 mmm copy (revno 20)
2011/06/02 Mark Mims no need for test data (revno 19)
2011/06/02 Mark Mims update docs for add-unit (revno 18)
2011/06/02 Mark Mims update notes (revno 17)
2011/06/02 Mark Mims little cleanup (revno 16)
2011/06/02 Mark Mims just write the file (revno 15)
2011/06/02 Mark Mims trying dpkg-reconfigure (revno 14)
2011/06/01 Mark Mims remove more cruft (revno 13)
Lint Check
  • err: Charms need a maintainer (See RFC2822) - Name <email>
  • err: revision file in root of charm is required
  • warn: Revision should not be stored in metadata.yaml anymore. Move it to the revision file

In other archives
Newer ~imbrandon:oneiric/drupal