-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
85 lines (55 loc) · 1.62 KB
/
Vagrantfile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
$script = <<-SCRIPT
echo I am provisioning
export DEBIAN_FRONTEND=noninteractive
apt-get -yq update
apt-get -yq upgrade
apt-get install -yq wget curl unzip devscripts equivs dpkg-dev
if [ $(lsb_release -c -s) == xenial ]; then apt-get -t xenial-backports install -yq debhelper; fi
cd /usr/src/
curl -L -o rtpengine.zip https://github.com/sipwise/rtpengine/archive/master.zip
unzip -q rtpengine.zip
cd rtpengine-master/
export DEB_BUILD_PROFILES="pkg.ngcp-rtpengine.nobcg729"
yes | mk-build-deps -i
dpkg-buildpackage
cd ..
dpkg -i ngcp-rtpengine-daemon*.deb
#apt-get -yq remove ngcp-rtpengine-build-deps
apt-get -yq autoremove
apt-get -yq clean
echo "[rtpengine]
table = -1
interface = $(hostname -i)
listen-ng = 2223" > /etc/rtpengine/rtpengine.conf
echo ...Provisioning complete
SCRIPT
servers=[
{
:hostname => "rtpengine-u18",
:box => "ubuntu/bionic64",
:ram => 512,
:cpu => 1,
:port => 16222
},
{
:hostname => "rtpengine-u16",
:box => "ubuntu/xenial64",
:ram => 512,
:cpu => 1,
:port => 16222
}
]
Vagrant.configure(2) do |config|
servers.each do |machine|
config.vm.provision "shell", inline: $script
config.vm.define machine[:hostname] do |node|
config.vm.network "forwarded_port", guest: 2223, host: machine[:port], protocol: "udp"
node.vm.box = machine[:box]
node.vm.hostname = machine[:hostname]
node.vm.provider "virtualbox" do |vb|
vb.name = machine[:hostname]
vb.memory = machine[:ram]
end
end
end
end