-
Notifications
You must be signed in to change notification settings - Fork 169
/
Vagrantfile
31 lines (25 loc) · 966 Bytes
/
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
require 'rbconfig'
require 'yaml'
PENTESTENV_PATH = File.dirname(__FILE__)
require File.expand_path('lib/pentestenv/customization', PENTESTENV_PATH)
# Fix for https://github.com/hashicorp/vagrant/issues/9442
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com') if
Gem::Version.new(Vagrant::VERSION) < Gem::Version.new('2.0.3')
rc = false
rc_filename = '.pentestrc'
if ENV['PENTESTRC'] && File.exist?(ENV['PENTESTRC'])
rc = ENV['PENTESTRC']
elsif File.exist?("#{ENV['PWD']}/#{rc_filename}")
rc = "#{ENV['PWD']}/#{rc_filename}"
elsif File.exist?("#{ENV['HOME']}/#{rc_filename}")
rc = "#{ENV['HOME']}/#{rc_filename}"
end
customization = Pentestenv::Customization.new(
rc ? YAML.safe_load(File.read(rc)) : { 'instances' => %w[kali] }
)
# rubocop:disable Style/ColonMethodCall
Vagrant::configure('2') do |config|
customization.register config, 'instances'
customization.register config, 'targets'
end
# rubocop:enable Style/ColonMethodCall