-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant-master.sh
39 lines (29 loc) · 903 Bytes
/
vagrant-master.sh
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
#!/bin/bash
vagrant init ubuntu/focal64
cat <<EOF > Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "slave" do |slave|
slave.vm.hostname = "slave"
slave.vm.box = "ubuntu/focal64"
slave.vm.network "private_network", ip: "192.168.30.21"
slave.vm.provision "shell", inline: <<-SHELL
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y avahi-daemon libnss-mdns
SHELL
end
config.vm.define "master" do |master|
master.vm.hostname = "master"
master.vm.box = "ubuntu/focal64"
master.vm.network "private_network", ip: "192.168.30.20"
master.vm.provision "shell", inline: <<-SHELL
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y avahi-daemon libnss-mdns
SHELL
end
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "2"
end
end
EOF
vagrant up