Created
June 12, 2019 07:16
-
-
Save zirconias/acb31cdbfd77775a3f137e5c55cee19a to your computer and use it in GitHub Desktop.
vagrant private_network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOX_IMAGE = "bento/ubuntu-18.04" | |
NODE_COUNT= 2 | |
Vagrant.configure("2") do |config| | |
config.vm.define "master" do |subconfig| | |
subconfig.vm.box = BOX_IMAGE | |
subconfig.vm.hostname = "master" | |
subconfig.vm.network :private_network, ip: "10.0.0.10" | |
end | |
(1..NODE_COUNT).each do |i| | |
config.vm.define "node#{i}" do |sub| | |
sub.vm.box = BOX_IMAGE | |
sub.vm.hostname = "node#{i}" | |
sub.vm.network :private_network, ip: "10.0.0.#{i+ 10}" | |
end | |
end | |
#install avahi on all machines | |
config.vm.provision "shell", inline: <<- SHELL | |
apt-get install -y avahi-daemon libnss-mdns | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment