~matsubara/+junk/maas-charm

« back to all changes in this revision

Viewing changes to hooks/db-relation-changed

  • Committer: Diogo Matsubara
  • Date: 2012-04-21 07:13:32 UTC
  • Revision ID: diogo.matsubara@canonical.com-20120421071332-l3c42v70rqwguyls
add instructions on how to deploy this charm, fix bunch of bugs in *-relation-changed scripts, fix install script and add some TODOs to it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
PASSWORD=`relation-get password`
6
6
HOST=`relation-get host`
7
7
DATABASE=`relation-get database`
 
8
ADMIN_USERNAME=$(config-get admin-username)
 
9
ADMIN_EMAIL=$(config-get admin-email)
8
10
# All values are set together, so checking on a single value is enough
9
11
# If $user is not set, DB is still setting itself up, we exit awaiting next run
10
12
[ -z "$USER" ] && exit 0
13
15
sed -i "s/'PASSWORD':.*/'PASSWORD': '$PASSWORD',/g" /etc/maas/maas_local_settings.py
14
16
sed -i "s/'HOST':.*/'HOST': '$HOST',/g" /etc/maas/maas_local_settings.py
15
17
sed -i "s/'NAME':.*/'NAME': '$DATABASE',/g" /etc/maas/maas_local_settings.py
 
18
maas flush --noinput
 
19
maas syncdb
 
20
maas migrate
 
21
maas createsuperuser --username=$ADMIN_USERNAME --email=$ADMIN_EMAIL --noinput
 
22
maas-import-isos -u
16
23
# Reload MAAS
17
 
/etc/init.d/apache2 restart
 
24
service apache2 restart
 
25
# Shutdown the local db instance.
 
26
service postgresql-9.1 stop