forked from csirtgadgets/bearded-avenger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile_buildbox
46 lines (37 loc) · 1.33 KB
/
Vagrantfile_buildbox
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
#e -*- mode: ruby -*-
# vi: set ft=ruby :
# https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_LOCAL = 'Vagrantfile.local'
unless File.directory?('deploymentkit')
puts "Please unzip the latest release of the deploymentkit before continuing..."
puts ""
puts "https://github.com/csirtgadgets/bearded-avenger-deploymentkit/wiki"
puts ""
exit
end
$script = <<SCRIPT
echo 'installing the basics'
apt-get update && apt-get install -y build-essential python-dev python2.7 python-pip python-dev aptitude \
python-pip libffi-dev libssl-dev sqlite3 software-properties-common
echo 'installing ansible'
pip install 'setuptools>=18.3,<34.0' 'ansible>=2.4,<2.5'
echo 'cleaning'
apt-get clean
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
echo 'done'
cat /dev/null > ~/.bash_history && history -c && exit
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: $script
config.vm.box = 'ubuntu/xenial64'
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "4096" ]
end
if File.file?(VAGRANTFILE_LOCAL)
external = File.read VAGRANTFILE_LOCAL
eval external
end
end