forked from Wildhoney/Magento-on-Angular
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
61 lines (43 loc) · 1.67 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Dependencies.
require 'yaml'
require 'pathname'
# Recursively finds a file in all parent directories.
def get_path(filename)
Pathname(__FILE__).ascend{ |directory|
path = directory + "mao.yml"; break path if path.file?
}
end
# Parse the configuration file.
options = YAML.load_file(get_path("mao.yml"))
VAGRANTFILE_API_VERSION = "2"
# IP addresses for the various components.
# ip_database = "#{options['ip_database']}"
# ip_magento = "#{options['ip_magento']}"
# ip_wordpress = "#{options['ip_wordpress']}"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Default options for the VM.
config.vm.box = "#{options['box']}"
config.vm.box_url = "http://files.vagrantup.com/#{options['box']}.box"
config.vm.network "forwarded_port", guest: 80, host: options['vagrant_port_http']
config.vm.network "forwarded_port", guest: 22, host: options['vagrant_port_ssh'], id: "ssh", auto_correct: true
# config.vm.network "private_network", ip: ip_database
# config.vm.network "private_network", ip: ip_magento
# config.vm.network "private_network", ip: ip_wordpress
config.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = options['vagrant_memory']
virtualbox.cpus = options['vagrant_cpus']
end
# Configure the synchronised directories.
# config.vm.synced_folder "./websites/magento", "/usr/share/nginx/www/magento", create: true, nfs: true
# Run the playbooks.
options['playbooks'].each do |playbook|
config.vm.provision "ansible" do |ansible|
if options['debug']
ansible.verbose = "vvvv"
end
ansible.playbook = "ansible/playbooks/#{playbook}.yml"
end
end
end