This is an old revision of the document!
For the sake of this example, we will assume that your MaaS IP is 192.168.200.1
sudo apt-get -y install golang-go
echo "GOPATH=$HOME/golang" >> ~/.bashrc echo "PATH=$PATH:$GOPATH/bin" >> ~/.bashrc . ~/.bashrc mkdir -p $GOPATH
This will add the necessary variables to facilitate building juju and to have juju (client) in your path once that's done.
go get launchpad.net/juju-core/...
rm -rf $GOPATH/src/launchpad.net/juju-core git clone git@github.com:cloudbase/juju-core.git $GOPATH/src/launchpad.net/juju-core cd $GOPATH/src/launchpad.net/juju-core && git checkout rebase-1.19
cd $GOPATH/src/code.google.com/p/go.crypto/ssh && hg update -r 191:2990fc550b9f # hack for this particular checkout of juju
go install -v launchpad.net/juju-core/...
Binaries will be in $GOPATH/bin
Instructions for the Windows version can be found HERE
juju init
Go to your MaaS web interface under:
http://192.168.200.1:5240/account/prefs/
Where you will find:
MAAS keys
sed -i 's/^default:.*/default: maas/g' ~/.juju/environments.yaml sed -i 's|maas-server: .*|maas-server: "http://192.168.200.1:5240/"|' ~/.juju/environments.yaml sed -i 's|maas-oauth: .*|maas-oauth: "<KEY FROM MAAS WEB UI>"|' ~/.juju/environments.yaml
If you want to upload your version of juju to MaaS to be used for deployment (and you do):
mkdir -p ~/.juju/tools/releases cd ~/.juju/tools/releases cp ~/golang/bin/jujud . tar -czf juju-1.19.1-trusty-amd64.tgz jujud rm jujud
Do this for every version of ubuntu that you want to have tools for. Precise and Trusty should be enough for development. While its good practice to build the binary on each platform to make sure no breakage will happen, I have found that the same binary works great on all versions.
For windows machines you will need the JujuService.exe service wrapper. It must be bundeled with the tools. You may download it from Here:
cd ~/.juju/tools/releases wget http://wiki.cloudbase.it/_media/juju-service.tar.gz # this might need auth tar -xzf juju-service.tar.gz cp /location/to/jujud.exe ./ # this will have to be copied over from your Windows machine (see above) tar -czf juju-1.19.1-win2012r2-amd64.tgz *.exe rm *.exe
do this for every version you want to support
juju-metadata generate-tools
This will generate all metadata from the tools found in ~/.juju/tools/releases. The metadata files can be found in:
ls -l /home/ubuntu/.juju/tools/streams/v1
juju sync-tools --source=/home/ubuntu/.juju/ --debug
juju bootstrap --debug --constraints tags=StateMachine
The constraint is used to target a particular machine. If omitted, juju will select a node at random. This will take a while. If your network is slow, the first time you try to bootstrap will fail. Juju has a timeout of 10 minutes. Don't panic, just run it again. MaaS caches your debs and the next time you try it will get from local cache.
juju status
this should output something similar to:
ubuntu@maas-controller:~$ juju status environment: maas machines: "0": agent-state: started agent-version: 1.19.1 dns-name: MaaS-StateMachine.maas instance-id: /api/1.0/nodes/node-4aecf276-c94c-11e3-95d7-525400a3b5b3/ series: trusty state-server-member-status: has-vote
If it does not, I have failed miserably to explain this procedure properly, and I am ashamed.