-
Notifications
You must be signed in to change notification settings - Fork 63
/
Vagrantfile
138 lines (121 loc) · 4.14 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# vagrant up tower --provider virtualbox
config.vm.define "tower" do |tower|
config.vm.hostname = "tower.local"
tower.vm.box = "ansible/tower"
tower.vm.network :private_network, ip: "192.168.56.2"
tower.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 2048
v.cpus = 2
end
end
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "centos/7"
################ VBox #############################
# let's use vbox
# TODO: let's refactor and build a function for god's sake
config.vm.define "jenkins_box" do |jenkins|
config.vm.hostname = "jenkins.local"
jenkins.vm.network :private_network, ip: "192.168.56.3"
jenkins.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 2048
end
end
config.vm.define "sonar_box" do |sonar|
config.vm.hostname = "sonar.local"
sonar.vm.network :private_network, ip: "192.168.56.4"
sonar.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 3000
end
end
config.vm.define "nexus_box", primary: true do |nexus|
config.vm.hostname = "nexus.local"
nexus.vm.network :private_network, ip: "192.168.56.5"
nexus.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 1024
end
end
config.vm.define "app_box", primary: true do |app|
config.vm.hostname = "app.local"
app.vm.network :private_network, ip: "192.168.56.11"
app.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 512
end
end
config.vm.define "app2_box", primary: true do |app2|
config.vm.hostname = "app2.local"
app2.vm.network :private_network, ip: "192.168.56.7"
app2.vm.provider :virtualbox do |v|
v.gui = false
v.memory = 512
end
end
################ LIB VIRT #########################
config.vm.define "jenkins" do |jenkins|
config.vm.hostname = "jenkins.local"
jenkins.vm.network :private_network, ip: "172.16.10.100"
jenkins.vm.provider :libvirt do |lb|
lb.memory = 2048
end
end
config.vm.define "sonar" do |sonar|
config.vm.hostname = "sonar.local"
sonar.vm.network :private_network, ip: "172.16.10.110"
sonar.vm.provider :libvirt do |lb|
lb.memory = 2048
end
end
config.vm.define "nexus", primary: true do |nexus|
config.vm.hostname = "nexus.local"
nexus.vm.network :private_network, ip: "172.16.10.120"
nexus.vm.provider :libvirt do |lb|
lb.memory = 1024
end
end
config.vm.define "app", primary: true do |app|
config.vm.hostname = "app.local"
app.vm.network :private_network, ip: "172.16.10.130"
app.vm.provider :libvirt do |lb|
lb.memory = 512
end
end
config.vm.define "app2", primary: true do |app2|
config.vm.hostname = "app2.local"
app2.vm.network :private_network, ip: "172.16.10.140"
app2.vm.provider :libvirt do |lb|
lb.memory = 512
end
end
config.vm.provider "libvirt" do |libvirt|
libvirt.storage_pool_name = "ext_storage"
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/alm.yml"
ansible.groups = {
"jenkins_server" => ["jenkins", "jenkins_box"],
"sonar_server" => ["sonar", "sonar_box"],
"nexus_server" => ["nexus", "nexus_box"],
"app_server" => ["app", "app2", "app_box", "app2_box"],
}
end
if Vagrant.has_plugin?("vagrant-hostmanager")
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
end
end