-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile.18.4
82 lines (74 loc) · 2.89 KB
/
Vagrantfile.18.4
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Gilbert MOISIO 2019
## Define port mapping to build the Fabric
spine_port_map = { 1 => [1,3],
2 => [2,4] }
leaf_port_map = { 1 => [1,2],
2 => [3,4] }
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
#######################
# Spine configuration #
#######################
(1..2).each do |id|
re_name = ( "spine0" + id.to_s ).to_sym
config.vm.define re_name do |vqfx|
vqfx.vm.host_name = "spine0#{id}"
vqfx.vm.box = "gmoisio/vQFX-re"
vqfx.vm.box_version = "18.4"
# Do not remove / No VMtools installed
vqfx.vm.synced_folder ".", "/vagrant", disabled: true
# Management port (em1 / em2)
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "vqfx_internal_#{id}"
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "reserved-bridge"
# (em3, em4)
(1..2).each do |seg_id|
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "non_used"
end
# (em5, em6)
(0..1).each do |seg_id|
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "seg#{spine_port_map[id][seg_id]}"
end
end
end
#######################
# Leaf configuration #
#######################
(1..2).each do |id|
re_name = ( "leaf0" + id.to_s ).to_sym
config.vm.define re_name do |vqfx|
vqfx.vm.host_name = "leaf0#{id}"
vqfx.vm.box = "gmoisio/vQFX-re"
vqfx.vm.box_version = "18.4"
# Do not remove / No VMtools installed
vqfx.vm.synced_folder ".", "/vagrant", disabled: true
# Management port (em1 / em2)
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "vqfx_internal_#{id}"
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "reserved-bridge"
# (em3, em4)
(1..2).each do |seg_id|
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "non_used"
end
# (em5, em6)
(0..1).each do |seg_id|
vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: "seg#{leaf_port_map[id][seg_id]}"
end
end
end
#######################
# Box provisioning #
#######################
config.vm.provision "ansible" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.groups = {
"qfx" => ["spine01", "spine02", "leaf01", "leaf02"],
"spine" => ["spine01", "spine02"],
"leaf" => ["leaf01", "leaf02"],
"all:children" => ["qfx"]
}
ansible.playbook = "site.yml"
ansible.tags = "ospf"
ansible.extra_vars = { ansible_python_interpreter:"/usr/bin/python3" }
end
end