-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVagrantfile
More file actions
138 lines (114 loc) · 4.21 KB
/
Vagrantfile
File metadata and controls
138 lines (114 loc) · 4.21 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
## Ion VM :
Vagrant.configure("2") do |config|
config.vm.box = "generic/debian12"
config.vm.box_version = "4.3.12"
config.vm.provider "libvirt"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
libvirt.uri = "qemu:///system"
end
config.vm.define "ion" do |ion|
ion.vm.provider :libvirt do |libvirt|
libvirt.cpus = 4
libvirt.memory = 2048
libvirt.graphics_type = "vnc"
libvirt.video_type = "qxl"
end
ion.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__auto: true, rsync__exclude: ".git/", rsync__args: ["--verbose", "--archive"]
ion.vm.network :private_network, ip: "192.168.50.10", libvirt__netmask: "255.255.255.0"
ion.vm.hostname = "ion-node"
ion.vm.provision "shell", reboot: true, inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get full-upgrade -y
EOF
# Install GUI
ion.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y xfce4 xfce4-goodies lightdm qemu-guest-agent
systemctl enable lightdm
EOF
# Install ION DTN
ion.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt install -y curl git ca-certificates make pkg-config libnl-genl-3-dev libevent-dev build-essential linux-headers-$(uname -r)
cd /home/vagrant
wget -q https://github.com/nasa-jpl/ION-DTN/archive/refs/tags/ion-open-source-4.1.3.tar.gz
tar -zxf ion-open-source-4.1.3.tar.gz
cd ION-DTN-ion-open-source-4.1.3
make
make install
EOF
end
# uD3TN
config.vm.define "ud3tn" do |ud3tn|
ud3tn.vm.provider :libvirt do |libvirt|
libvirt.cpus = 2
libvirt.memory = 2048
libvirt.graphics_type = "vnc"
libvirt.video_type = "qxl"
end
ud3tn.vm.synced_folder ".", "/vagrant", type: "rsync", disable: true
ud3tn.vm.network :private_network, ip: "192.168.50.20", libvirt__netmask: "255.255.255.0"
ud3tn.vm.hostname = "ud3tn-node"
ud3tn.vm.provision "shell", reboot: true, inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get full-upgrade -y
EOF
# Install GUI
ud3tn.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y xfce4 xfce4-goodies lightdm qemu-guest-agent
systemctl enable lightdm
EOF
ud3tn.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y curl git ca-certificates make build-essential libsqlite3-dev sqlite3 python3.11-venv libjansson-dev
git clone --recursive https://gitlab.com/d3tn/ud3tn.git
cd ud3tn
make posix -j8
make virtualenv
source .venv/bin/activate
make update-virtualenv
EOF
end
# 3rd VM to test
config.vm.define "ipn30" do |ipn30|
ipn30.vm.provider :libvirt do |libvirt|
libvirt.cpus = 4
libvirt.memory = 2048
libvirt.graphics_type = "vnc"
libvirt.video_type = "qxl"
end
ipn30.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__auto: true, rsync__exclude: ".git/", rsync__args: ["--verbose", "--archive"]
ipn30.vm.network :private_network, ip: "192.168.50.30", libvirt__netmask: "255.255.255.0"
ipn30.vm.hostname = "ipn30-node"
ipn30.vm.provision "shell", reboot: true, inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get full-upgrade -y
EOF
# Install GUI
ipn30.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y xfce4 xfce4-goodies lightdm qemu-guest-agent
systemctl enable lightdm
EOF
# Install ION DTN
ipn30.vm.provision "shell", inline: <<-EOF
export DEBIAN_FRONTEND=noninteractive
apt install -y curl git ca-certificates make pkg-config libnl-genl-3-dev libevent-dev build-essential linux-headers-$(uname -r)
cd /home/vagrant
wget -q https://github.com/nasa-jpl/ION-DTN/archive/refs/tags/ion-open-source-4.1.3.tar.gz
tar -zxf ion-open-source-4.1.3.tar.gz
cd ION-DTN-ion-open-source-4.1.3
make
make install
EOF
end
end