Charm needed: Drupal

Bug #805955 reported by Ahmed Kamal
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Admin links Drupal module
Invalid
Undecided
Unassigned
Juju Charms Collection
Incomplete
High
Unassigned

Bug Description

Juju charm Drupal
author: Nick Barcet <email address hidden>

Example deployment:

1. Setup your site specific parameters in drupal.yaml
> vi drupal.yaml
a list of all settable parameter with description is available using
> juju get drupal
or listing config.yaml

2. Deployment with mysql and haproxy
>juju bootstrap
>juju deploy --config drupal.yaml drupal
>juju deploy mysql
>juju deploy haproxy
>juju add-relation mysql drupal
>juju add-relation drupal haproxy
>juju expose haproxy

3. Accessing your new drupal site should be ready at
http://<haproxy-machine-addr>/. To find out the public address of haproxy,
look for it in the output of the 'juju status' command.

Note about HTTPS:
-----------------
to enable https access to your site, you can set "do_https" to the value of the
 https port you want to listen to (443 is the default for https). You will
also need to provide the paths to *existing* SSLCertificate (ssl_crt) and key
(ssl_key). This means that you will have to use juju scp to upload your certicates
*before* making the config changes and adding other units.

You can also use the default ssl snake oil certificates provided by the ssl-cert
package:
  # This config activates https on port 443
  do_https: 443
  ssl_crt: /etc/ssl/certs/ssl-cert-snakeoil.pem
  ssl_key: /etc/ssl/private/ssl-cert-snakeoil.key

If the certificate you provide is invalid, apache will fail to load.
If the paths you provide are invalid, the https site will no be activated.
juju debug-log should be your friend, go have a look.

The certificates should be uploaded to the first unit you start, a peer relation
between all units will ensure that they will be reused identically everywhere.

Note about mount interface:
---------------------------
This has not been tested much due to the lack of working providers at the moment,
but the idea is that once we have a working nfs, glusterfs or ceph charm, we should
be able to have a shared file system for files (private, public and temp). This
mounts to /var/opt/drupal/files-shared. Until the mount relation is in place, the
files are stored in /var/opt/drupal/files.

Note about drupal/sites directory:
----------------------------------
Multiple units of drupal will see their drupal/sites directory content automatically
rsynced each time there is a change in the config. The master for this is always
the unit with the lowest id. When you want to make a change their (for example
to modify a template), do it on the master and then change the conf-version variable
value with "juju set drupal conf-version=new_value" so that the rsync takes place.

Note about adding modules:
--------------------------
Just add the modules you want to the modules variable. For example, the command
"juju set drupal modules="cck zen l10n_update" will add and enable these modules if
they were not previously installed.

Note about variable setting:
----------------------------
Any drupal variables can be set via the variable-set configuration. For example,
if you want to put your site offline use:
  $juju set drupal variable-set="site_offline=1"
you can specify multiple variables separating them with spaces:
  $juju set drupal variable-set="site_offline=1 preprocess_css=1"

Tags: new-charm
Ahmed Kamal (kim0)
Changed in principia:
assignee: nobody → abedeltawil (abedeltawil)
tags: added: new-formula
Changed in principia:
status: New → Incomplete
status: Incomplete → New
Changed in principia:
status: New → In Progress
Changed in drupal-admin-links:
assignee: nobody → Abed El Tawil (abedeltawil)
Changed in drupal-admin-links:
assignee: Abed El Tawil (abedeltawil) → nobody
Mark Mims (mark-mims)
Changed in drupal-admin-links:
status: New → Invalid
Changed in drupal-admin-links:
assignee: nobody → Abed El Tawil (abedeltawil)
status: Invalid → New
Changed in principia:
assignee: Abed El Tawil (abedeltawil) → nobody
assignee: nobody → Abed El Tawil (abedeltawil)
Changed in drupal-admin-links:
assignee: Abed El Tawil (abedeltawil) → nobody
Ahmed Kamal (kim0)
Changed in drupal-admin-links:
status: New → Invalid
Changed in drupal-admin-links:
assignee: nobody → Abed El Tawil (abedeltawil)
status: Invalid → In Progress
status: In Progress → Invalid
assignee: Abed El Tawil (abedeltawil) → nobody
description: updated
summary: - Formula needed: Drupal
+ Charm needed: Drupal
tags: added: new-charm
removed: new-formula
Revision history for this message
Mark Mims (mark-mims) wrote :

anybody know how to clear out the "admin links" part of this bug?

Revision history for this message
Jorge Castro (jorge) wrote :

You can't, the best we can do is keep it invalid (LP bug)

Revision history for this message
Jorge Castro (jorge) wrote :

Abed, are you still working on this?

Revision history for this message
Nick Barcet (nijaba) wrote :

Removing the new-charm tag as there is nothing to review

tags: removed: new-charm
Jorge Castro (jorge)
Changed in charm:
assignee: Abed El Tawil (abedeltawil) → Nick Barcet (nijaba)
Revision history for this message
Nick Barcet (nijaba) wrote :

Charm done. Review welcome :)

tags: added: new-charm
Changed in charm:
status: In Progress → Fix Committed
description: updated
Revision history for this message
Nick Barcet (nijaba) wrote :

Pulling back as some tests are not passing successfully. sorry

Changed in charm:
status: Fix Committed → In Progress
tags: removed: new-charm
Revision history for this message
Nick Barcet (nijaba) wrote :

Ok, now ready for review

Changed in charm:
status: In Progress → Fix Committed
tags: added: new-charm
Nick Barcet (nijaba)
description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hey Nick! Glad to see this one is looking almost ready. Things look great, just a few bits:

[1]
pear channel-discover pear.drush.org

pear channel-discover downloads channel.xml via HTTP, with no cryptographic verification. There's no need for this though, drush is available in the archive. Change this to install the drush package from the archive.

[2]
No error checking is done in man of the hooks. set -e FTW. :)

------------
non blockers:

[3]
Several hooks are not idempotent for a few reasons. drupal-setup-cron, for instance, uses 'ln -s' without -f, so if the symlink already exists, it will exit with an error. Just do 'ln -sf' to avoid that. There are others. The best way to test this is to add an upgrade-charm hook like this:

#!/bin/sh
home=`dirname $0`
$home/stop
$home/install
$home/config-changed
$home/start

Then simply do an 'upgrade-charm' on the deployed service, and it will re-run all these hooks. For the relations, just add-remove the relations a few times.

They should also be tolerant of the system state. For instance:

service idmapd start

Doesn't handle a user having started it already. So do

service idmapd status || service idmapd start

Or

service idmapd start || :

[4]
hooks/db-relation-changed .. shouldn't apache be restarted after the ssl certs are synced?

---------------

Anyway, there's more to review, but I stopped there. I think the mount relation stuff will go away when subordinate charms arrive, as we'll need filesystem-specific client charms to be able to mount things like ceph and gluster.

Fix the blockers, and I think its ready for promulgate.

Changed in charms:
status: Fix Committed → Incomplete
importance: Undecided → High
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hey Nick, any progress on this?

Changed in charms:
assignee: Nick Barcet (nijaba) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.