forked from faceleg/vagrant-php-5.5.latest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
65 lines (51 loc) · 1.94 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
# -*- 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 = "Official Ubuntu 12.04 daily Cloud Image amd64 (VirtualBox 4.1.12)"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.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.55.55"
config.vm.network :forwarded_port,
guest: 22,
host: 2255,
id: "ssh",
auto_correct: true
config.vm.hostname = "www.bpb-vagrant-php-55.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-55",
"--natdnshostresolver1", "on"
]
end
config.vm.provision :shell, :path => "shell/update-apt.sh"
config.vm.provision :shell, :path => "shell/install-ruby.sh"
# 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