This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
export VAGRANT_VAGRANTFILE=Vagrantfile_buildbox | ||
|
||
if [ -e cifv3.box ]; then | ||
rm cifv3.box | ||
fi | ||
|
||
time vagrant up | ||
vagrant package --output cifv3.box | ||
vagrant box add cifv3 cifv3.box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters