public
Last active

decent-sized juju stack

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#!/bin/bash
 
echo "deploying stack"
 
deploy_ha_mysql() {
juju deploy mysql masterdb
juju deploy mysql slavedb -n2
juju add-relation masterdb:master slavedb:slave
}
 
deploy_common_services() {
deploy_ha_mysql
juju deploy nfs uploadstore
juju deploy memcached
juju deploy ganglia
juju expose ganglia
}
deploy_common_services
 
deploy_wiki() {
local wiki_name=$1
 
juju deploy mediawiki $wiki_name -n4
juju deploy varnish ${wiki_name}head
 
juju add-relation ganglia $wiki_name
juju add-relation masterdb:db ${wiki_name}:db
juju add-relation slavedb:db ${wiki_name}:slave
juju add-relation uploadstore $wiki_name
juju add-relation memcached $wiki_name
juju add-relation $wiki_name ${wiki_name}head
 
juju expose ${wiki_name}head
 
}
deploy_wiki "wiki1"
deploy_wiki "wiki2"
 
echo "done"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.