-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVagrantfile
538 lines (513 loc) · 24 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
#
#
# Note: This is basically a Ruby Script. Variables and strings can be manipulated
# in the same was as any Ruby Script.
#
# Select which system to run by setting it to 'true'
# Recommended to only operate one at a time.
system_status_ubuntu_latest = false
system_status_focal = false
system_status_bionic = false
system_status_xenial = false
system_status_buster = false
system_status_stretch = false
system_status_leap = false
system_status_fedora_32 = false
system_status_fedora_33 = false
system_status_centos_8 = true
# Select whether or not to clone the Assets-Production repo as part of provisioning
clone_game_assets = false
# Selected Networks
base_network_vb = "172.16.12"
base_network_lvt = "172.16.13"
# VM Hardware Resource Configuration
base_memory = 3096
base_cpu_count = 2
base_vram = 128
# 6-month Ubuntu Release
image_ubuntu_latest = "ubuntu/groovy64"
# LTS Ubuntu Releases
image_ubuntu_focal = "ubuntu/focal64"
image_ubuntu_bionic = "ubuntu/bionic64"
image_ubuntu_xenial = "ubuntu/xenial64"
# Debian Releases
image_debian_buster = "debian/buster64"
image_debian_stretch = "debian/stretch64"
# OpenSuse Leap 15.2
image_leap = "opensuse/Leap-15.2.x86_64"
image_fedora_32 = "generic/fedora32"
image_fedora_33 = "generic/fedora33"
image_centos_8 = "generic/centos8"
# Desktop Environment packages by platform
# Package should be meta-package that installs both the Desktop Environment
# and the Login Manager.
ubuntu_desktop_environment = "lubuntu-desktop"
debian_desktop_environment = "gnome"
# opensuse_desktop_environment = "patterns-xfce-xfce"
fedora_desktop_environment = "@kde-desktop-environment"
# centos_desktop_environment = "@kde-desktop-environment"
vegastrike_assets_repository = "https://github.com/vegastrike/Assets-Production.git"
# Note: Vagrant tells the VMs to use the UI as this is more of a basic
# VM creation & configuration than testing automation, so the user will
# need to be able to utilize a GUI interface when all is said and one.
Vagrant.configure("2") do |config|
if system_status_ubuntu_latest then
config.vm.define "vegastrike_ubuntu_latest" do | vs_ubuntu_latest |
vs_ubuntu_latest.vm.box = "#{image_ubuntu_latest}"
vs_ubuntu_latest.vm.network "private_network", ip: "#{base_network_vb}.10"
vs_ubuntu_latest.vm.hostname = "vegastrike-ubuntu-latest"
vs_ubuntu_latest.vm.boot_timeout = 900
vs_ubuntu_latest.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_ubuntu_latest.vm.provision "shell", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{ubuntu_desktop_environment}" virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
SHELL
if clone_game_assets then
vs_ubuntu_latest.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_ubuntu_latest.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_focal then
config.vm.define "vegastrike_ubuntu_focal" do | vs_ubuntu_focal |
vs_ubuntu_focal.vm.box = "#{image_ubuntu_focal}"
vs_ubuntu_focal.vm.network "private_network", ip: "#{base_network_vb}.11"
vs_ubuntu_focal.vm.hostname = "vegastrike-ubuntu-focal"
vs_ubuntu_focal.vm.boot_timeout = 900
vs_ubuntu_focal.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_ubuntu_focal.vm.provision "shell", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{ubuntu_desktop_environment}" virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
SHELL
if clone_game_assets then
vs_ubuntu_focal.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_ubuntu_focal.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_bionic then
config.vm.define "vegastrike_ubuntu_bionic" do | vs_ubuntu_bionic |
vs_ubuntu_bionic.vm.box = "#{image_ubuntu_bionic}"
vs_ubuntu_bionic.vm.network "private_network", ip: "#{base_network_vb}.13"
vs_ubuntu_bionic.vm.hostname = "vegastrike-ubuntu-bionic"
vs_ubuntu_bionic.vm.boot_timeout = 900
vs_ubuntu_bionic.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_ubuntu_bionic.vm.provision "shell", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{ubuntu_desktop_environment}" virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
SHELL
if clone_game_assets then
vs_ubuntu_bionic.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_ubuntu_bionic.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_xenial then
config.vm.define "vegastrike_ubuntu_xenial" do | vs_ubuntu_xenial |
vs_ubuntu_xenial.vm.box = "#{image_ubuntu_xenial}"
vs_ubuntu_xenial.vm.network "private_network", ip: "#{base_network_vb}.12"
vs_ubuntu_xenial.vm.hostname = "vegastrike-ubuntu-xenial"
vs_ubuntu_xenial.vm.boot_timeout = 900
vs_ubuntu_xenial.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_ubuntu_xenial.vm.provision "shell", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{ubuntu_desktop_environment}" virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
SHELL
if clone_game_assets then
vs_ubuntu_xenial.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_ubuntu_xenial.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_buster then
config.vm.define "vegastrike_debian_buster" do | vs_debian_buster |
vs_debian_buster.vm.box = "#{image_debian_buster}"
vs_debian_buster.vm.network "private_network", ip: "#{base_network_vb}.14"
vs_debian_buster.vm.hostname = "vegastrike-debian-buster"
vs_debian_buster.vm.boot_timeout = 900
vs_debian_buster.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Debian_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_debian_buster.vm.provision "shell", privileged: true, inline: <<-SHELL
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{debian_desktop_environment}"
SHELL
if clone_game_assets then
vs_debian_buster.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_debian_buster.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_stretch then
config.vm.define "vegastrike_debian_stretch" do | vs_debian_stretch |
vs_debian_stretch.vm.box = "#{image_debian_stretch}"
vs_debian_stretch.vm.network "private_network", ip: "#{base_network_vb}.15"
vs_debian_stretch.vm.hostname = "vegastrike-debian-stretch"
vs_debian_stretch.vm.boot_timeout = 900
vs_debian_stretch.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Debian_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_debian_stretch.vm.provision "shell", privileged: true, inline: <<-SHELL
echo "deb http://deb.debian.org/debian stretch-backports contrib main" | tee /etc/apt/sources.list.d/stretch-backports.list
apt-get update
apt-get install -y ansible python-apt
apt-get install -y git
apt-get install -y "#{debian_desktop_environment}"
apt-get install -y linux-image-amd64 linux-headers-amd64 -t stretch-backports
apt-get install -y virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 -t stretch-backports
SHELL
if clone_game_assets then
vs_debian_stretch.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
vs_debian_stretch.vm.provision "shell", privileged: true, inline: <<-SHELL
reboot
SHELL
end
end
if system_status_leap then
config.vm.define "vegastrike_opensuse_leap" do | vs_opensuse_leap |
vs_opensuse_leap.vm.box = "#{image_leap}"
vs_opensuse_leap.vm.network "private_network", ip: "#{base_network_vb}.16"
vs_opensuse_leap.vm.hostname = "vegastrike-opensuse-leap"
vs_opensuse_leap.vm.boot_timeout = 900
vs_opensuse_leap.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "OpenSuse_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_opensuse_leap.vm.provision "shell", privileged: true, inline: <<-SHELL
zypper --non-interactive refresh
zypper --non-interactive update
zypper --non-interactive install -y xorg-x11
zypper --non-interactive install -y -t pattern xfce
zypper --non-interactive install -y git MozillaFirefox
SHELL
# vs_opensuse_leap.vm.provision "shell", privileged: false, inline: <<-SHELL
# startxfce4
# SHELL
if clone_game_assets then
vs_opensuse_leap.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
# vs_opensuse_leap.vm.provision "shell", privileged: true, inline: <<-SHELL
# reboot
# SHELL
end
end
if system_status_fedora_32 then
config.vm.define "vegastrike_fedora_32" do | vs_fedora_32 |
vs_fedora_32.vm.box = "#{image_fedora_32}"
vs_fedora_32.vm.network "private_network", ip: "#{base_network_vb}.17"
vs_fedora_32.vm.hostname = "vegastrike-fedora-32"
vs_fedora_32.vm.boot_timeout = 900
vs_fedora_32.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Fedora_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_fedora_32.vm.provision "shell", privileged: true, inline: <<-SHELL
dnf install -y #{fedora_desktop_environment}
dnf install -y \
git \
firefox \
switchdesk
SHELL
vs_fedora_32.vm.provision "shell", privileged: false, inline: <<-SHELL
switchdesk kde
# startx
SHELL
if clone_game_assets then
vs_fedora_32.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
# vs_fedora_32.vm.provision "shell", privileged: true, inline: <<-SHELL
# reboot
# SHELL
end
end
if system_status_fedora_33 then
config.vm.define "vegastrike_fedora_33" do | vs_fedora_33 |
vs_fedora_33.vm.box = "#{image_fedora_33}"
vs_fedora_33.vm.network "private_network", ip: "#{base_network_vb}.18"
vs_fedora_33.vm.hostname = "vegastrike-fedora-33"
vs_fedora_33.vm.boot_timeout = 900
vs_fedora_33.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "Fedora_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_fedora_33.vm.provision "shell", privileged: true, inline: <<-SHELL
dnf install -y #{fedora_desktop_environment}
dnf install -y \
git \
firefox \
switchdesk
SHELL
vs_fedora_33.vm.provision "shell", privileged: false, inline: <<-SHELL
switchdesk kde
# startx
SHELL
if clone_game_assets then
vs_fedora_33.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
# vs_fedora_33.vm.provision "shell", privileged: true, inline: <<-SHELL
# reboot
# SHELL
end
end
if system_status_centos_8 then
config.vm.define "vegastrike_centos_8" do | vs_centos_8 |
vs_centos_8.vm.box = "#{image_centos_8}"
vs_centos_8.vm.network "private_network", ip: "#{base_network_vb}.19"
vs_centos_8.vm.hostname = "vegastrike-centos-8"
vs_centos_8.vm.boot_timeout = 900
vs_centos_8.vm.provider "virtualbox" do |vb|
vb.memory = "#{base_memory}"
vb.cpus = "#{base_cpu_count}"
vb.customize ["modifyvm", :id, "--ostype", "CentOS_64"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--nestedpaging", "on"]
vb.customize ["modifyvm", :id, "--vram", "#{base_vram}"]
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
vb.customize ["modifyvm", :id, "--audioout", "on"]
vb.gui = true
end
vs_centos_8.vm.provision "shell", privileged: true, inline: <<-SHELL
dnf update -y
dnf config-manager --set-enabled powertools
dnf groupinstall "KDE Plasma Workspaces" "base-x" -y
dnf install -y \
git \
firefox
SHELL
# vs_centos_8.vm.provision "shell", privileged: false, inline: <<-SHELL
# switchdesk kde
# # startx
# SHELL
if clone_game_assets then
vs_centos_8.vm.provision "shell", privileged: false, inline: <<-SHELL
pushd /home/vagrant
if [ ! -d "Assets-Production" ]; then
git clone #{vegastrike_assets_repository}
else
pushd "Assets-Production"
git pull
popd
fi
popd
SHELL
end
# vs_centos_8.vm.provision "shell", privileged: true, inline: <<-SHELL
# reboot
# SHELL
end
end
end