forked from faceleg/vagrant-php-5.3.latest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
57 lines (44 loc) · 1.63 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Install vagrant-list for the ability to list running vagrant boxes
# https://github.com/joshmcarthur/vagrant-list
# vagrant plugin install vagrant-list
# Install vagrant-hostsupdater to automatically add hosts entries
# https://github.com/cogitatio/vagrant-hostsupdater
# vagrant plugin install vagrant-hostsupdater
Vagrant::configure("2") do |config|
config.vm.box = "Debian"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210.box"
load File.expand_path("./user/directories.pp")
config.vm.synced_folder $projects, "/srv/www/", :nfs => true
config.vm.synced_folder "./configuration/", "/configuration/", :nfs => true
config.vm.network :private_network,
ip: "192.168.50.4"
config.vm.hostname = "www.bpb-vagrant.dev"
load File.expand_path("../user/vhosts.pp", __FILE__)
config.hostsupdater.aliases = $vhosts.keys
config.hostsupdater.remove_on_suspend = true
config.vm.provider :virtualbox do |vb|
vb.gui = false
vb.customize [
"modifyvm", :id,
"--memory", "1024",
"--name", "bpb-php-53",
"--natdnshostresolver1", "on"
]
end
# Prepare facts
$facts = "export FACTER_vagrant_apache_vhosts=\""
$vhosts.each do |name, directory|
$facts += name + "," + directory + " "
end
$facts += "\";\n"
load File.expand_path("../user/dbs.pp", __FILE__)
$facts += "export FACTER_dbs=\""
$dbs.each do |name, username_password|
$facts += name + "," + username_password + " "
end
$facts += "\";\n"
$bootstrap = File.read("./shell/bootstrap.sh")
config.vm.provision :shell, :inline => $facts + $bootstrap;
end