-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
48 lines (38 loc) · 1.88 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
current_dir = File.dirname(File.expand_path(__FILE__))
configs = YAML.load_file("#{current_dir}/etc/config.yaml")
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "codealist-lamp"
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.provision :shell, :path => "install/composer.sh"
if configs['configs']['services']['phpmyadmin'] == true
config.vm.provision :shell, :path => "install/phpmyadmin.sh"
end
if configs['configs']['services']['xdebug'] == true
config.vm.provision :shell, :path => "install/xdebug.sh"
end
if configs['configs']['services']['nodejs'] == true
config.vm.provision :shell, :path => "install/nodejs.sh"
end
if configs['configs']['services']['redis'] == true
config.vm.provision :shell, :path => "install/redis.sh"
end
if configs['configs']['services']['memcached'] == true
config.vm.provision :shell, :path => "install/memcached.sh"
end
if configs['configs']['services']['mailutils'] == true
config.vm.provision :shell, :path => "install/mailutils.sh"
end
if configs['configs']['services']['elasticsearch'] == true
config.vm.provision :shell, :path => "install/elasticsearch.sh"
end
config.vm.provision "shell", inline: "sudo mysql -uroot -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${configs[configs][general][mysql_root_pwd]}';\" 2> /dev/null"
config.vm.network "private_network", ip: configs['configs']['general']['public_ip']
config.vm.synced_folder "./etc", "/etc/vagrant", owner: "vagrant", group: "vagrant"
config.vm.synced_folder "./sites", "/var/www", owner: "vagrant", group: "vagrant"
config.vm.synced_folder "./scripts", "/scripts", owner: "vagrant", group: "vagrant"
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/me.pub"
end