2
# Here do anything needed to install the service
3
# i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot
4
# Make sure this hook exits cleanly and is idempotent, common problems here are failing to account for a debconf question on a dependency, or trying to pull from github without installing git first.
5
set -eux # -x for verbose logging to juju debug-log
7
CHECKSUM="8614d80e8afdb9d936e8574b24e9b405"
8
HOST=`unit-get private-address`
4
KIBANA_SOURCE=$(config-get kibana_source)
5
KIBANA_SOURCE_UNPACK_DIRECTORY=$(config-get kibana_source_unpack_directory)
6
KIBANA_SOURCE_CHECKSUM=$(config-get kibana_source_checksum)
7
HOST=$(unit-get private-address)
10
9
juju-log "install dependency"
11
10
apt-get install -y curl wget git nginx
13
12
juju-log "download kibana from elasticsearch.org"
14
wget -q -O /tmp/kibana-latest.tgz https://download.elasticsearch.org/kibana/kibana/kibana-latest.tar.gz
13
wget -q -O /tmp/kibana.tgz ${KIBANA_SOURCE}
14
echo "${KIBANA_SOURCE_CHECKSUM} /tmp/kibana.tgz" > /tmp/kibana.tgz.md5
15
md5sum -c /tmp/kibana.tgz.md5
16
17
install -o root -g root -m 0644 files/charm/nginx.conf /etc/nginx/sites-available/kibana
17
18
install -o root -g root -m 0644 files/charm/nginx_lb.conf /etc/nginx/sites-available/es_cluster
21
tar xzvf /tmp/kibana-latest.tgz
23
mv kibana-latest kibana3
22
tar xzvf /tmp/kibana.tgz
23
mv ${KIBANA_SOURCE_UNPACK_DIRECTORY} kibana3
25
25
rm -f /etc/nginx/sites-enabled/default
29
rm -f /usr/share/kibana3/config.js
30
install -o root -g root -m 0644 files/charm/config.js /usr/share/kibana3/config.js
29
rm -f /srv/kibana3/config.js
30
install -o root -g root -m 0644 files/charm/config.js /srv/kibana3/config.js
33
33
ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana