-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
44 lines (34 loc) · 1.02 KB
/
Vagrantfile
File metadata and controls
44 lines (34 loc) · 1.02 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
domain_name = 'development.%s' % [IO.read('DOMAIN_NAME').strip!]
hosts = [
{ name: 'development-1', ip: '192.168.100.10', group: 'webservers' }
]
groups = hosts.reduce({}) {|memo, host|
group = host[:group]
if !memo.has_key?(group)
memo[group] = []
end
memo[group].push(host[:name])
memo
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
hosts.each do |host|
config.vm.define host[:name] do |c|
c.vm.hostname = host[:name]
c.vm.network :private_network, ip: host[:ip], netmask: '255.255.255.0'
c.vm.synced_folder "..", "/var/apps"
c.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/site.yml"
ansible.groups = groups
ansible.extra_vars = {
domain_name: domain_name,
slack_url: "http://not-a-domain",
}
end
end
end
end