forked from defanator/modsecurity-performance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
59 lines (48 loc) · 1.68 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
mem = 1024
cpus = 2
host = RbConfig::CONFIG['host_os']
# provide more resources to vm
if host =~ /darwin/
mem = [4096, `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 2].min
elsif host =~ /linux/
cpus = [2, `getconf _NPROCESSORS_ONLN`.to_i / 2].max
mem = [cpus * 512, `awk '/MemTotal/ {print $2}' /proc/meminfo`.to_i / 1024 / 2].min
end
config.vm.box = "generic/ubuntu1604"
config.vm.hostname = "vagrant"
# use NFS for performant file sharing
config.vm.network :private_network, ip: '192.168.50.50'
config.vm.synced_folder ".", "/vagrant", type: "nfs", nfs_version: 3
# mount states and pillars to the appropriate locations
config.vm.synced_folder "states/", "/srv/salt/", type: "nfs", nfs_version: 3
config.vm.synced_folder "pillars/", "/srv/pillar/", type: "nfs", nfs_version: 3
# provider specific settings
config.vm.provider "virtualbox" do |vbox, override|
vbox.cpus = cpus
vbox.memory = mem
end
config.vm.provider :libvirt do |libvirt, override|
libvirt.cpus = cpus
libvirt.memory = mem
libvirt.driver = "kvm"
libvirt.cpu_mode = "host-passthrough"
end
config.vm.provision :salt do |salt|
salt.minion_config = "minion"
salt.install_type = "stable"
salt.bootstrap_options = "-n -X"
salt.masterless = true
salt.run_highstate = true
end
config.vm.define "default", primary: true do |default|
end
config.vm.define "debian8", autostart: false do |debian8|
debian8.vm.box = "debian/jessie64"
end
config.vm.define "debian9", autostart: false do |debian9|
debian9.vm.box = "debian/stretch64"
end
end