-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
33 lines (28 loc) · 1.03 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
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-20.04"
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 1
end
config.vm.provision "shell", path: "scripts/provision-boxes.sh"
# Install Avahi to enable mDNS resolution between boxes
# https://stackoverflow.com/a/30780347
config.vm.provision "allow_guest_host_resolution",
type: "shell",
inline: <<-SHELL
apt-get update -y
apt-get install -y avahi-daemon libnss-mdns
SHELL
# The provider must be provisioned before the consumer
config.vm.define "provider", primary: true do |c|
c.vm.hostname = "provider"
c.vm.provision "shell", inline: "cd /vagrant && task clean && task provision-example-provider"
c.vm.network "private_network", type: "dhcp"
end
config.vm.define "consumer" do |c|
c.vm.hostname = "consumer"
c.vm.provision "shell", inline: "cd /vagrant && task provision-example-consumer"
c.vm.network "private_network", type: "dhcp"
c.vm.network "forwarded_port", guest: 15672, host: 30200
end
end