1
# http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage
3
pkgs="libzookeeper-java zookeeper juju bzr"
10
CHARMS_D="$CHARMS_D/$JUJU_SERIES"
12
ZIMMER_IP=192.168.123.2
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
20
sudo apt-get --assume-yes install $pkgs </dev/null
22
mkdir -p "${JUJU_D%/*}"
23
#( cd ${JUJU_D%/*} && bzr branch lp:juju )
24
( cd ${JUJU_D%/*} && bzr branch $JUJU_ORIGIN juju )
27
( cd "$CHARMS_D" && bzr branch lp:charm/mysql && bzr branch lp:charm/wordpress )
32
cat > ~/.juju/environments.yaml <<EOF
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
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
49
export PATH="$JUJU_D/bin:$HOME/bin:/usr/sbin:/usr/bin:/sbin:/bin" PYTHONPATH=$JUJU_D
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
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
61
juju add-relation --environment $ENAME wordpress mysql
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.