forked from zenoamaro/ansible-role-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
61 lines (48 loc) · 1.59 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 :
Vagrant.configure '2' do |config|
# Standalone boxed install
# ------------------------
# Provision this machine to obtain a standalone box
# installation listening on the default port.
config.vm.define 'boxed', primary: true do |box|
box.vm.box = "ubuntu/trusty64"
# Configure the network topology to your needs
config.vm.network :private_network, ip: "192.168.33.10"
# config.vm.network :public_network
config.vm.provision :ansible do |ansible|
ansible.playbook = './boxed.yml'
ansible.inventory_path = './inventory'
end
# Forward this installation to a port on the host
# config.vm.network :forwarded_port, guest: 80, host: 10080
end
# Test machines
# -------------
# These test machines will configure the installation with all
# its extensions enabled, in order to test the validity
# of the role.
# Ubuntu machines are available:
# - "test-ubuntu-precise"
# - "test-ubuntu-trusty"
def apply_test_ansible_defaults(ansible)
ansible.playbook = './test.yml'
ansible.inventory_path = './inventory'
end
config.vm.define 'test-ubuntu-trusty' do |box|
box.vm.box = "ubuntu/trusty64"
config.vm.network :private_network, ip: "192.168.33.21"
config.vm.provision :ansible do |ansible|
apply_test_ansible_defaults ansible
ansible.extra_vars = {}
end
end
config.vm.define 'test-ubuntu-precise' do |box|
box.vm.box = "ubuntu/precise64"
config.vm.network :private_network, ip: "192.168.33.20"
config.vm.provision :ansible do |ansible|
apply_test_ansible_defaults ansible
ansible.extra_vars = {}
end
end
end