Last active
September 25, 2022 17:54
-
-
Save marcuslang/9e31543ec583ddeef29734ab47ea0474 to your computer and use it in GitHub Desktop.
Create multiple Vagrant VMs with different ips in a for loop
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
(1..3).each do |i| | |
config.vm.define "node-#{i}" do |node| | |
node.vm.box = "ubuntu/trusty64" | |
node.vm.network "private_network", ip: "192.168.25.#{i}", auto_config: false | |
node.vm.provision "shell", inline: "echo hello from node #{i}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thx!