-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
36 lines (30 loc) · 1.48 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
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/bionic64'
config.ssh.insert_key = false
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provider :virtualbox do |v|
v.memory = 256
v.linked_clone = true
end
config.vm.define "web1" do |web|
web.vm.hostname = "web1.test"
web.vm.provision :shell, inline: "fallocate -l 1G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile && echo '/swapfile none swap sw 0 0' >> /etc/fstab"
web.vm.network :private_network, ip: "192.168.60.4"
end
config.vm.define "web2" do |web|
web.vm.hostname = "web2.test"
web.vm.provision :shell, inline: "fallocate -l 1G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile && echo '/swapfile none swap sw 0 0' >> /etc/fstab"
web.vm.network :private_network, ip: "192.168.60.5"
end
config.vm.define "nginx" do |db|
db.vm.hostname = "nginx.test"
db.vm.provision :shell, inline: "fallocate -l 1G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile && echo '/swapfile none swap sw 0 0' >> /etc/fstab"
db.vm.network :private_network, ip: "192.168.60.7"
end
# Database server.
config.vm.define "db" do |db|
db.vm.hostname = "db.test"
db.vm.provision :shell, inline: "fallocate -l 1G /swapfile && chmod 0600 /swapfile && mkswap /swapfile && swapon /swapfile && echo '/swapfile none swap sw 0 0' >> /etc/fstab"
db.vm.network :private_network, ip: "192.168.60.6"
end
end