Add support for the nrpe-external-master subordinate, add preinstall and upgrade hook.

This commit is contained in:
andrew.glen-young@canonical.com 2013-03-01 12:36:31 -05:00
parent add08ae35a
commit 25f2c6f96a
4 changed files with 21 additions and 0 deletions

View File

@ -17,3 +17,13 @@ options:
ssl_cert:
type: string
description: X.509 certificate in PEM format (starts "-----BEGIN CERTIFICATE-----")
nagios_context:
default: "juju"
type: string
description: |
Used by the nrpe-external-master subordinate charm.
A string that will be prepended to instance name to set the host name
in nagios. So for instance the hostname would be something like:
juju-myservice-0
If you're running multiple environments with the same services in them
this allows you to differentiate between them.

View File

@ -33,6 +33,8 @@ fi
juju-log "rabbitmq-server: Firing hook $ARG0."
function install_hook() {
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f";done )
[[ ! `which pwgen` ]] && apt-get -y install pwgen
DEBIAN_FRONTEND=noninteractive apt-get -qqy \
install --no-install-recommends rabbitmq-server
@ -41,6 +43,10 @@ function install_hook() {
open-port 5672/tcp
}
function upgrade_charm {
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f";done )
}
function amqp_changed() {
# Connecting clients should request a username and vhost.
# In reponse, we generate a password for new users,
@ -109,6 +115,7 @@ case $ARG0 in
"install") install_hook ;;
"start") service rabbitmq-server status || service rabbitmq-server start ;;
"stop") service rabbitmq-server status && service rabbitmq-server stop ;;
"upgrade-charm") upgrade_charm ;;
"amqp-relation-joined") exit 0 ;;
"amqp-relation-changed") amqp_changed ;;
"cluster-relation-joined") cluster_joined ;;

1
hooks/upgrade-charm Symbolic link
View File

@ -0,0 +1 @@
rabbitmq-relations

View File

@ -8,6 +8,9 @@ description: |
provides:
amqp:
interface: rabbitmq
nrpe-external-master:
interface: nrpe-external-master
scope: container
peers:
cluster:
interface: rabbitmq