-
Notifications
You must be signed in to change notification settings - Fork 2
/
provision.sh
61 lines (37 loc) · 1.11 KB
/
provision.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# update and unzip
dpkg -s unzip &>/dev/null || {
apt-get -y update && apt-get install -y unzip
}
if [ ! -f /usr/local/bin/consul ]; then
# install consul
cd /usr/local/bin
version='0.8.0'
wget https://releases.hashicorp.com/consul/${version}/consul_${version}_linux_amd64.zip -O consul.zip
unzip consul.zip
rm consul.zip
chmod +x consul
# Dnsmasq Configuration
apt-get install -y dnsmasq
echo "server=/consul/127.0.0.1#8600" >> /etc/dnsmasq.d/10-consul
echo "nameserver 127.0.0.1" > /etc/resolv.conf
systemctl start dnsmasq
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
# apt-get install locales
# dpkg-reconfigure locales
systemctl enable dnsmasq
systemctl restart dnsmasq
apt install -y build-essential
apt-get install -y libzmqpp-dev
# protobuf c++ target
apt-get install -y libprotobuf-dev
fi
if [ ! -f /etc/systemd/system/consul.service ]; then
cp /vagrant/consul.service /etc/systemd/system/consul.service
fi
if [ ! -d /etc/systemd/system/consul.d ]; then
mkdir -p /etc/systemd/system/consul.d
fi