forked from xinsnake/vagrant-webdev-arch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
67 lines (53 loc) · 2.24 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
#
# vim: syntax=ruby
#
$script = <<'SCRIPT'
# begin
startAt=$(date +"%s")
# run root script
sudo -i /vagrant/env/scripts/provision-root.sh
# run vagrant script
sudo -u vagrant -i /vagrant/env/scripts/provision-vagrant.sh
# TODO: run check command
# sudo -i /vagrant/env/scripts/provision-check.sh
# echo configuration
endAt=$(date +"%s")
diff=$(($endAt-$startAt))
echo
echo "======================================================================="
echo ' _ _ '
echo ' (_) | | '
echo ' __ ___ _ __ ___ _ __ __ _| | _____ '
echo ' \ \/ / | '"'"'_ \/ __| '"'"'_ \ / _` | |/ / _ \ '
echo ' > <| | | | \__ \ | | | (_| | < __/ '
echo ' /_/\_\_|_| |_|___/_| |_|\__,_|_|\_\___| '
echo
echo "Provisioning finished, just few things you need to do before you start!"
echo
echo " 1. Please add the following lines to your hosts file:"
echo " 192.168.155.10 localhost.dev"
echo " 192.168.155.10 pm.localhost.dev"
echo
echo " 2. Try to visit http://localhost.dev/ and you should see phpinfo()"
echo
echo " 3. Try to visit http://pm.localhost.dev/ and you should see phpMyAdmin"
echo
echo "Provisioning took $(($diff / 60)) minutes and $(($diff % 60)) seconds"
echo
echo "======================================================================="
echo
SCRIPT
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "terrywang/arch"
config.vm.box_url = "http://cloud.terry.im/vagrant/archlinux-x86_64.box"
config.vm.provision "shell", inline: $script
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
#config.vm.synced_folder "./", "/vagrant/", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'fsc']
config.vm.network "private_network", ip: "192.168.155.10", auto_config:false
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--usb", "off"]
vb.customize ["modifyvm", :id, "--groups", "/xinsnake"]
end
end