Skip to content

Commit

Permalink
Rebase on trunk changes
Browse files Browse the repository at this point in the history
  • Loading branch information
javacruft committed Mar 26, 2014
2 parents b3d0b32 + 65882b0 commit 2806786
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
19 changes: 19 additions & 0 deletions README
Expand Up @@ -15,3 +15,22 @@ Deploy the service:
Enable SSL, passing in the key and certificate as configuration settings:

juju set rabbit ssl_enabled=True ssl_key="`cat rabbit-server-privkey.pem`" ssl_cert="`cat rabbit-server-cert.pem`"

To change the source that the charm uses for packages:

juju set rabbit source="cloud:precise-icehouse"

This will enable the Icehouse pocket of the Cloud Archive (which contains a new version of RabbitMQ) and upgrade the install to the new version.

The source option can be used in a few different ways:

source="ppa:james-page/testing" - use the testing PPA owned by james-page
source="http://myrepo/ubuntu main" - use the repository located at the provided URL

The charm also supports use of arbitary archive key's for use with private repositories:

juju set rabbit key="C6CEA0C9"

Note that in clustered configurations, the upgrade can be a bit racey as the services restart and re-cluster; this is resolvable using:

juju resolved --retry rabbitmq/1
2 changes: 1 addition & 1 deletion config.yaml
Expand Up @@ -75,7 +75,7 @@ options:
ha-vip-only:
type: boolean
default: False
descriptions: |
description: |
By default, without pairing with hacluster charm, rabbitmq will deploy
in active/active/active... HA. When pairied with hacluster charm, it
will deploy as active/passive. By enabling this option, pairing with
Expand Down
20 changes: 14 additions & 6 deletions hooks/rabbitmq_server_relations.py
Expand Up @@ -62,12 +62,7 @@
@hooks.hook('install')
def install():
pre_install_hooks()
add_source(config('source'), config('key'))
apt_update(fatal=True)
apt_install(rabbit.PACKAGES, fatal=True)
open_port(5672)
chown(RABBIT_DIR, rabbit.RABBIT_USER, rabbit.RABBIT_USER)
chmod(RABBIT_DIR, 0o775)
# NOTE(jamespage) install actually happens in config_changed hook


def configure_amqp(username, vhost):
Expand Down Expand Up @@ -506,6 +501,19 @@ def configure_rabbit_ssl():

@hooks.hook('config-changed')
def config_changed():
# Add archive source if provided
add_source(config('source'), config('key'))
apt_update(fatal=True)

# Install packages to ensure any changes to source
# result in an upgrade if applicable.
apt_install(rabbit.PACKAGES, fatal=True)

open_port(5672)

chown(RABBIT_DIR, rabbit.RABBIT_USER, rabbit.RABBIT_USER)
chmod(RABBIT_DIR, 0o775)

if config('management_plugin') is True:
rabbit.enable_plugin(MAN_PLUGIN)
open_port(55672)
Expand Down
1 change: 1 addition & 0 deletions hooks/start
1 change: 1 addition & 0 deletions hooks/stop

0 comments on commit 2806786

Please sign in to comment.