forked from nickschuch/vd8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
75 lines (66 loc) · 2.12 KB
/
Copy pathVagrantfile
File metadata and controls
75 lines (66 loc) · 2.12 KB
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
75
# -*- mode: ruby -*-
# vi: set ft=ruby :
##
# Variables.
##
box = 'precise32'
url = 'http://files.vagrantup.com/' + box + '.box'
hostname = 'd8'
domain = 'dev'
cpus = '1'
ram = '1024'
# These allow for puppet facts to be set. We use these for
# assigning roles.
# eg. "drupal" => "true" could setup a Drupal site.
facts = {
'fqdn' => hostname + '.' + domain,
# We set these so we can marry up permissions.
'vagrant_uid' => Process.uid,
'vagrant_group' => 'dialout'
}
##
# Configuration.
##
Vagrant.configure("2") do |config|
config.vm.box = box
config.vm.hostname = hostname + '.' + domain
config.vm.box_url = url
if Vagrant.has_plugin?('vagrant-auto_network')
# Network configured as per bit.ly/1e0ZU1r
config.vm.network :private_network, :ip => "0.0.0.0", :auto_network => true
else
config.vm.network :private_network, :ip => "192.168.50.10"
end
# We want to cater for both Unix and Windows.
if RUBY_PLATFORM =~ /linux|darwin/
config.vm.synced_folder(
".",
"/vagrant",
:nfs => true,
:map_uid => 0,
:map_gid => 0,
)
else
config.vm.synced_folder ".", "/vagrant"
end
# Virtualbox provider configuration.
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", cpus]
vb.customize ["modifyvm", :id, "--memory", ram]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"]
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
vb.customize ["modifyvm", :id, "--nictype2", "Am79C973"]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
# Provisioners.
config.vm.provision :shell, :path => "puppet/provision.sh"
config.vm.provision :puppet do |puppet|
puppet.facter = facts
puppet.manifests_path = "puppet"
puppet.manifest_file = "site.pp"
puppet.module_path = "puppet/modules"
end
end