Rebase on trunk changes

This commit is contained in:
James Page 2014-03-26 10:23:01 +00:00
commit 28067861bf
5 changed files with 36 additions and 7 deletions

19
README
View File

@ -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

View File

@ -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

View File

@ -62,12 +62,7 @@ NAGIOS_PLUGINS = '/usr/local/lib/nagios/plugins'
@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):
@ -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)

1
hooks/start Symbolic link
View File

@ -0,0 +1 @@
rabbitmq_server_relations.py

1
hooks/stop Symbolic link
View File

@ -0,0 +1 @@
rabbitmq_server_relations.py