forked from WEEE-Open/tarallo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
61 lines (52 loc) · 2.11 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
Vagrant.configure("2") do |config|
ENV["LC_ALL"] = "en_US.UTF-8"
#config.vm.box = "centos/7"
config.vm.box = "geerlingguy/centos7"
config.vm.hostname = "tarallo"
config.vm.synced_folder ".", "/vagrant", disabled: true
if Vagrant::Util::Platform.windows? then
config.vm.synced_folder "./utils/data", "/data", type: "smb"
config.vm.synced_folder ".", "/var/www/html/server", type: "smb"
else
config.vm.synced_folder "./utils/data", "/data"
config.vm.synced_folder ".", "/var/www/html/server"
end
if Vagrant::Util::Platform.windows? then
config.vm.synced_folder "./utils/xdebug", "/xdebug", type: "smb",
:mount_options => ['dir_mode=0777,file_mode=0666']
else
config.vm.synced_folder "./utils/xdebug", "/xdebug",
#:owner => 'nobody',
#:group => 'nobody',
:mount_options => ['dmode=777', 'fmode=666']
# or use 775, 664 and user/group php-fpm, but that user doesn't exist before provisioning...
end
config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 81, host: 8081, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 3306, host: 3307, host_ip: "127.0.0.1"
config.vm.provider "virtualbox" do |v|
v.name = "tarallo"
end
# This works only if Windows uses SMB...
if Vagrant::Util::Platform.windows? then
config.vm.synced_folder "./utils/provision", "/provision", type: "smb",
:owner => 'vagrant',
:group => 'vagrant',
:mount_options => ['dir_mode=0775,file_mode=0775']
config.vm.provision :shell, :inline => "/provision/windows-host.sh"
else
config.vm.provision "ansible" do |ansible|
#ansible.verbose = "v"
ansible.compatibility_mode = "2.0"
ansible.playbook = "utils/provision/playbook.yml"
end
end
config.vm.provision "db_update", type: "shell", run: "always" do |up|
up.privileged = false
up.inline = "php /var/www/html/server/bin/update.php"
end
config.vm.provision "test_db_update", type: "shell", run: "always" do |up|
up.privileged = false
up.inline = "php /var/www/html/server/bin/update.php test_db"
end
end