-
Notifications
You must be signed in to change notification settings - Fork 38
/
Vagrantfile
executable file
·41 lines (36 loc) · 1.19 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Variaveis
VAGRANTFILE_API_VERSION = 2
# Chamando modulo YAML
require 'yaml'
# Lendo o arquivo YAML com as configuracoes do ambiente
env = YAML.load_file('environment.yaml')
# Limitando apenas a ultima versao estavel do Vagrant instalada
Vagrant.require_version '>= 2.0.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Iteracao com os servidores do ambiente
env.each do |env|
config.vm.define env['name'] do |srv|
srv.vm.box = env['box']
srv.vm.hostname = env['hostname']
srv.vm.network 'private_network', ip: env['ipaddress']
if env['additional_interface'] == true
srv.vm.network 'private_network', ip: '1.0.0.100',
auto_config: false
end
srv.vm.provider 'virtualbox' do |vb|
vb.name = env['name']
vb.memory = env['memory']
vb.cpus = env['cpus']
end
srv.vm.provision 'ansible_local' do |ansible|
ansible.playbook = env['provision']
ansible.install_mode = 'pip'
ansible.become = true
ansible.become_user = 'root'
ansible.compatibility_mode = '2.0'
end
end
end
end