Convert to Juju Charm

This commit is contained in:
Adam Gandelman 2011-09-16 14:55:02 -07:00
parent 61b687f46b
commit 6e72e5b5c2
4 changed files with 19 additions and 19 deletions

View File

@ -1,45 +1,45 @@
options:
nova-release:
default: distro
type: str
type: string
description: Nova PPA from which to install. (distro, trunk, milestone, milestone-proposed)
nova-config:
default: /etc/nova/nova.conf
type: str
type: string
description: Full path to nova.conf
rabbit-user:
default: nova
type: str
type: string
description: Username used to access rabbitmq queue
rabbit-vhost:
default: nova
type: str
type: string
decsription: Rabbitmq vhost
db-user:
default: nova
type: str
type: string
description: Username for database access
nova-db:
default: nova
type: str
type: string
description: Database name
# needed if using flatmanager
bridge-interface:
default: br100
type: str
type: string
description: Bridge interface to be configured
bridge-ip:
default: 11.0.0.1
type: str
type: string
description: IP to be assigned to bridge interface
bridge-netmask:
default: 255.255.255.0
type: str
type: string
description: Netmask to be assigned to bridge interface
# needed if using flatdhcpmanager
flat-interface:
default: eth1
type: str
type: string
description: Network interface on which to build bridge

View File

@ -20,7 +20,7 @@ function set_or_update {
[[ -z $KEY ]] && exit 1
[[ -z $VALUE ]] && exit 1
cat $NOVA_CONF | grep "\-\-$KEY=$VALUE" >/dev/null \
&& ensemble-log "nova-compute: $KEY=$VALUE already set" exit 0
&& juju-log "nova-compute: $KEY=$VALUE already set" exit 0
if cat $NOVA_CONF | grep "\-\-$KEY=" >/dev/null ; then
sed -i "s|\(--$KEY=\).*|\1$VALUE|" $NOVA_CONF
else
@ -47,7 +47,7 @@ function nova_ctl {
fi
ACTION=$2
if [[ -z $CTL ]] || [[ -z $ACTION ]] ; then
ensemble-log "ERROR nova_ctl: Not enough arguments"
juju-log "ERROR nova_ctl: Not enough arguments"
exit 1
fi
for i in $CTL ; do
@ -60,7 +60,7 @@ function nova_ctl {
nova_ctl_status $i && service $i restart || service $i start ;;
esac
if [[ $? != 0 ]] ; then
ensemble-log "nova_ctl: ERROR - Service $i failed to $ACTION"
juju-log "nova_ctl: ERROR - Service $i failed to $ACTION"
fi
done
}
@ -107,7 +107,7 @@ function configure_network_manager {
"FlatDHCPManager")
FLAT_INTERFACE=$(config-get flat-interface)
EC2_HOST=$(relation-get ec2_host)
[[ -z $EC2_HOST ]] && ensemble-log "nova-compute: Missing EC2_HOST" \
[[ -z $EC2_HOST ]] && juju-log "nova-compute: Missing EC2_HOST" \
&& exit 0
set_or_update network_manager nova.network.manager.FlatDHCPManager
# the interface on which bridge is built
@ -123,7 +123,7 @@ function configure_network_manager {
function add_ppa {
# don't setup PPA, install from archive
[[ $PPA == "distro" ]] && return 0
ensemble-log "nova-compute: Configuring PPA access for $PPA"
juju-log "nova-compute: Configuring PPA access for $PPA"
. /etc/lsb-release
PPA_URL="deb http://ppa.launchpad.net/nova-core/$PPA/ubuntu $DISTRIB_CODENAME main"
echo "Executing: add-apt-repository \"$PPA_URL\"" || exit 1

View File

@ -14,7 +14,7 @@ function install_hook {
apt-get update || exit 1
apt-get -y install $SERVICES || exit 1
# XXX sudo on the ensemble sample AMI doesnt function
# XXX sudo on the juju sample AMI doesnt function
# as it should (doesn't include suoders.d/*). do this
# manually until we can use any AMI
echo "nova ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers
@ -23,7 +23,7 @@ function install_hook {
}
function amqp_joined {
ensemble-log "amqp_joined: requesting credentials for $RABBIT_USER"
juju-log "amqp_joined: requesting credentials for $RABBIT_USER"
echo "amqp_joined: requesting credentials for $RABBIT_USER"
relation-set username=$RABBIT_USER
relation-set vhost=$RABBIT_VHOST
@ -47,7 +47,7 @@ function amqp_changed {
function db_joined {
# tell mysql provider which database we want. it will create it and give us
# credentials
ensemble-log "db_joined: requesting database access to $NOVA_DB for $DB_USER@$IP"
juju-log "db_joined: requesting database access to $NOVA_DB for $DB_USER@$IP"
relation-set database=$NOVA_DB
relation-set username=$DB_USER
relation-set hostname=$HOSTNAME

View File

@ -1,6 +1,6 @@
ensemble: formula
name: nova-compute
revision: 36
revision: 37
summary: "OpenStack compute"
description: |
OpenStack Compute, codenamed Nova, is a cloud computing fabric controller. In