~lutostag/ubuntu/utopic/maas/1.5.2

« back to all changes in this revision

Viewing changes to vdenv/HOWTO.juju

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-03-15 18:14:08 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120315181408-zgl94hzo0x4n99an
Tags: 0.1+bzr295+dfsg-0ubuntu2
* debian/patches:
  - 01-fix-database-settings.patch: Update to set PSERV_URL.
  - 02-pserv-config.patch: Set port to 8001.
* debian/maas.postinst: Run maas-import-isos on install.
* debian/control: Depends on rabbitmq-server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage
 
2
 
 
3
pkgs="libzookeeper-java zookeeper juju bzr"
 
4
 
 
5
JUJU_D=$HOME/juju
 
6
JUJU_ORIGIN="lp:juju"
 
7
JUJU_SERIES="precise"
 
8
 
 
9
REPO="$HOME/charms"
 
10
CHARMS_D="$CHARMS_D/$JUJU_SERIES"
 
11
 
 
12
ZIMMER_IP=192.168.123.2
 
13
 
 
14
id_rsa="$HOME/.ssh/id_rsa"
 
15
[ -f "$id_rsa" ] || ssh-keygen -t rsa -N '' -f "$id_rsa"
 
16
read x y z < "$id_rsa"
 
17
grep -q "$y" ~/.ssh/authorized_keys ||
 
18
   cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
 
19
 
 
20
sudo apt-get --assume-yes install $pkgs </dev/null
 
21
 
 
22
mkdir -p "${JUJU_D%/*}"
 
23
#( cd ${JUJU_D%/*} && bzr branch lp:juju )
 
24
( cd ${JUJU_D%/*} && bzr branch $JUJU_ORIGIN juju )
 
25
 
 
26
mkdir -p "$CHARMS_D"
 
27
( cd "$CHARMS_D" && bzr branch lp:charm/mysql && bzr branch lp:charm/wordpress )
 
28
 
 
29
ENAME="odev"
 
30
 
 
31
mkdir ~/.juju/
 
32
cat > ~/.juju/environments.yaml <<EOF
 
33
environments:
 
34
  $ENAME:
 
35
    type: orchestra
 
36
    juju-origin: $JUJU_ORIGIN
 
37
    orchestra-server: $ZIMMER_IP
 
38
    orchestra-user: cobbler
 
39
    orchestra-pass: xcobbler
 
40
    acquired-mgmt-class: orchestra-juju-acquired
 
41
    available-mgmt-class: orchestra-juju-available
 
42
    admin-secret: SEEKRIT
 
43
    storage-url: http://$ZIMMER_IP/webdav
 
44
    authorized-keys: $(cat ~/.ssh/id_rsa.pub)
 
45
    data-dir: $HOME/juju-data/$ENAME
 
46
    default-series: $JUJU_SERIES
 
47
EOF
 
48
 
 
49
export PATH="$JUJU_D/bin:$HOME/bin:/usr/sbin:/usr/bin:/sbin:/bin" PYTHONPATH=$JUJU_D
 
50
 
 
51
# now start your juju bootstrap node.  this will take some time, as we're
 
52
# doing a full install into the VM.
 
53
juju bootstrap --environment $ENAME
 
54
 
 
55
# now create the mysql and wordpress units
 
56
# this takes quite a while as full VM install of each
 
57
juju deploy --environment $ENAME --repository $REPO local:mysql
 
58
juju deploy --environment $ENAME --repository $REPO local:wordpress
 
59
 
 
60
# now link the two
 
61
juju add-relation --environment $ENAME wordpress mysql
 
62
 
 
63
# juju status:
 
64
# FIXME: resolution will try to use dns and will not work for nodes
 
65
#        workaround: can add 192.168.123.1 to /etc/resolv.conf 'server' line
 
66
# FIXME: juju status hangs "connecting to environment" during bootstrap
 
67
#        node installation.  The post should call home and indicate done.  so
 
68
#        juju could/should know that its still installing.