-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
74 lines (56 loc) · 2.17 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative 'lib/vagrant-host'
require_relative 'lib/vagrant-ssh'
require_relative 'lib/vagrant-utils'
require_relative 'lib/plugins/vagrant-proxy'
require_relative 'lib/plugins/vagrant-goodhosts'
require_relative 'lib/plugins/vagrant-vbguest'
require_relative 'lib/providers/vagrant-vb'
PROJECT_PATH = File.dirname(File.expand_path(__FILE__))
VCONFIG = Utils.load_config(File.join(PROJECT_PATH, 'vagrant.yaml'))
Vagrant.require_version ">= #{VCONFIG[:min_required_version]}"
Utils.ensure_plugins(VCONFIG[:plugins])
HOST = VCONFIG[:host]
SSH = VCONFIG[:ssh]
Vagrant.configure('2') do |config|
#-- Vagrant SSH settings --#
Ssh.configure(config, SSH)
#-- ProxyConf plugin settings --#
Proxy.configure(config, HOST) if Vagrant.has_plugin?('vagrant-proxyconf')
#-- GoodHosts plugin settings --#
GoodHosts.configure(config, HOST) if Vagrant.has_plugin?('vagrant-goodhosts')
#-- VirtualBox Guest Additions plugin --#
VbGuest.configure(config, HOST) if Vagrant.has_plugin?('vagrant-vbguest')
#-- VM Settings --#
config.vm.define HOST[:name] do |node|
#-- Box Settings --#
node.vm.box = HOST[:box]
node.vm.box_url = HOST[:box_url]
node.vm.box_check_update = HOST[:box_update]
node.vm.hostname = HOST[:name]
node.vm.boot_timeout = HOST[:boot_timeout]
#-- Provider Settings --#
node.vm.provider 'virtualbox' do |vb|
vb.gui = HOST[:gui]
vb.name = HOST[:name]
VirtualBox.resources(vb, HOST)
VirtualBox.modify_vm(vb, HOST)
VirtualBox.guest_property(vb, HOST)
end
# -- Disks --#
Host.disks(node.vm, HOST)
#-- Networking --#
Host.networking(node.vm, HOST)
#-- Shared Folders --#
Host.synced_folders(node.vm, HOST)
#-- File Provisioners --#
Host.file_provision(node.vm, HOST)
#-- Shell Provisioners --#
Host.shell_provision(node.vm, HOST)
#-- Local Ansible Provisioner -- ##
Host.ansible_provision(node.vm, HOST)
#-- Post up message --#
Host.post_up_message(node.vm, HOST)
end
end