-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVagrantfile
215 lines (206 loc) · 7.46 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# -*- 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.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "trusty64"
# vagrant issues #1673..fixes hang with configure_networks
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.provider :libvirt do |domain|
domain.memory = 256
domain.nested = true
end
openstack_ver = 'liberty'
# deployment server
config.vm.define :deployserver do |node|
node.vm.hostname = 'deployosad'
node.vm.synced_folder '.', '/vagrant', :disabled => true
node.vm.network :private_network,
:ip => '169.2.2.2/24', # bogus IP so tha vagrant-libvirt can create virt_network
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
node.vm.network :private_network,
:ip => '169.2.3.3/24',
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'container_mgmt'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'deployserver.yml'
ansible.extra_vars = {
openstack_release: openstack_ver,
ubuntu_repo: 'http://192.168.50.1:3142/ubuntu'
}
end
node.vm.network "forwarded_port", guest: 3142, host: 8090
end
# Repo servers
config.vm.define :reposerver do |node|
node.vm.hostname = 'reposerver'
node.vm.synced_folder '.', '/vagrant', :disabled => true
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'container_mgmt'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'reposerver.yml'
ansible.extra_vars = {
apt_url: 'http://192.168.50.1:3142',
openstack_release: openstack_ver
}
end
end
# LoadBalancing VM
config.vm.define :loadbalancer do |node|
node.vm.hostname = 'loadbalancer'
node.vm.synced_folder '.', '/vagrant', :disabled => true
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'container_mgmt'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'haproxy.yml'
ansible.extra_vars = {
apt_url: 'http://192.168.50.1:3142',
openstack_release: openstack_ver
}
end
node.vm.network "forwarded_port", guest: 443, host: 8081
end
# OSAD Server
# Minimum requirement is 4GB of RAM and 2 CPU for an install to finish
# in a reasonable about of time. About 3 hours from scratch.
# TODO make memory or cpus a vagrant variable and disk variable
config.vm.define :stackserver do |node|
node.vm.provider :libvirt do |domain|
domain.memory = 4096
domain.cpus = 2
# for cinder block services whenever i get to it.
domain.storage :file, :size => '40G'
end
node.vm.hostname = 'stackserver'
node.vm.synced_folder '.', '/vagrant', :disabled => true
# eth1
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
# eth2
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'container_mgmt'
# eth3
node.vm.network :private_network,
:ip => '169.3.4.20/24', # bogus Ip so it can create libvirt network
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'vxlan_tunnel'
# eth4
node.vm.network :private_network,
:ip => '169.2.4.10/24', # bogus IP so it can create libvirt network
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'gatewayrtr'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'stackserver.yml'
ansible.extra_vars = {
apt_url: 'http://192.168.50.1:3142',
openstack_release: openstack_ver
}
end
end
# Optional 2nd Compute Node
#config.vm.define :stackserver2 do |node|
# node.vm.provider :libvirt do |domain|
# domain.memory = 2048
# domain.cpus = 2
# # for cinder block services whenever i get to it.
# domain.storage :file, :size => '40G'
# end
# node.vm.hostname = 'stackserver2'
# node.vm.synced_folder '.', '/vagrant', :disabled => true
# #eth1
# node.vm.network :private_network,
# :auto_config => false,
# :libvirt__forward_mode => 'veryisolated',
# :libvirt__dhcp_enabled => false,
# :libvirt__network_name => 'host_mgmt'
# #eth2
# node.vm.network :private_network,
# :auto_config => false,
# :libvirt__forward_mode => 'veryisolated',
# :libvirt__dhcp_enabled => false,
# :libvirt__network_name => 'container_mgmt'
# #eth3
# node.vm.network :private_network,
# :auto_config => false,
# :libvirt__forward_mode => 'veryisolated',
# :libvirt__dhcp_enabled => false,
# :libvirt__network_name => 'vxlan_tunnel'
# #eth4
# node.vm.network :private_network,
# :auto_config => false,
# :libvirt__forward_mode => 'veryisolated',
# :libvirt__dhcp_enabled => false,
# :libvirt__network_name => 'gatewayrtr'
# node.vm.provision :ansible do |ansible|
# ansible.playbook = 'stackserver.yml'
# ansible.extra_vars = {
# apt_url: 'http://192.168.50.1:3142',
# openstack_release: openstack_ver
# }
# end
#end
## Gateway router
config.vm.define :gatewayrouter do |node|
node.vm.provider :libvirt do |domain|
domain.memory = 128
end
node.vm.synced_folder '.', '/vagrant', :disabled => true
node.vm.hostname = 'gatewayrouter'
node.vm.network :private_network,
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'host_mgmt'
node.vm.network :private_network,
:ip => '169.2.4.10/24',
:auto_config => false,
:libvirt__forward_mode => 'veryisolated',
:libvirt__dhcp_enabled => false,
:libvirt__network_name => 'gatewayrtr'
node.vm.provision :ansible do |ansible|
ansible.playbook = 'gatewayrouter.yml'
ansible.extra_vars = {
apt_url: 'http://192.168.50.1:3142',
openstack_release: openstack_ver
}
end
end
end