-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVagrantfile
43 lines (34 loc) · 1.52 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
require 'yaml'
current_dir = File.dirname(File.expand_path(__FILE__))
configs = YAML.load_file("#{current_dir}/config.yml")
vagrant_config = configs['configs']
config.vm.synced_folder "./", "/vagrant", owner: "vagrant", mount_options: ["dmode=775,fmode=600"]
#Controler VM
config.vm.define "controller" do |controller|
controller.vm.hostname = vagrant_config['sbt']['hostname']
controller.vm.box = vagrant_config['sbt']['box']
controller.vm.provider :virtualbox do |v|
v.memory = vagrant_config['sbt']['ram']
v.cpus = vagrant_config['sbt']['cpu']
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
end
controller.vm.network :private_network, ip: vagrant_config['sbt']['ip']
controller.vm.network :forwarded_port, guest: 9000, host: 9000
controller.vm.network :forwarded_port, guest: 8080, host: 8080
controller.vm.network :forwarded_port, guest: 81, host: 81
controller.vm.provision "ansible_local" do |ansible|
ansible.galaxy_role_file = "requirements.yml"
ansible.playbook = "setup.yml"
ansible.verbose = true
ansible.install = true
ansible.limit = "all"
ansible.provisioning_path = "/vagrant/provisioning"
#ansible.inventory_path = "hosts"
end
end
end