~jonnybgod/charms/trusty/mesos-master/trunk

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Joao Ribeiro
  • Date: 2015-07-29 22:48:14 UTC
  • Revision ID: jonnybgod@gmail.com-20150729224814-f3qfxvhh1fvpv4ij
Initial charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -ex
 
4
 
 
5
# Install is guaranteed to run once per rootfs
 
6
 
 
7
juju-log "Installing mesos-master on $JUJU_UNIT_NAME"
 
8
status-set maintenance "Fetching and installing Mesos"
 
9
 
 
10
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
 
11
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
 
12
CODENAME=$(lsb_release -cs)
 
13
 
 
14
# Add the repository
 
15
echo "deb http://repos.mesosphere.com/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
 
16
sudo apt-get -y update
 
17
sudo apt-get -y install mesos marathon
 
18
 
 
19
sudo mkdir /etc/zookeeper/conf/
 
20
sudo mkdir /etc/mesos/
 
21
sudo mkdir /etc/mesos-master/
 
22
 
 
23
patt='([[:digit:]]+)'
 
24
[[ $JUJU_UNIT_NAME =~ $patt ]] && serverN=10#${BASH_REMATCH[1]}
 
25
sudo sh -c "echo $serverN > /etc/zookeeper/conf/myid"
 
26
 
 
27
sudo sh -c "echo $JUJU_UNIT_NAME > /etc/mesos-master/hostname"
 
28
sudo sh -c "echo `unit-get private-address` > /etc/mesos-master/ip"
 
 
b'\\ No newline at end of file'