vagrant批量创建机器,多机器创建
Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "echo Hello" config.vm.define "web" do |web| web.vm.box = "apache" end config.vm.define "db" do |db| db.vm.box = "mysql" end end
配置文件vagrantfile增加如上代码即可,config.vm.define定义一个新的机器
参考https://developer.hashicorp.com/vagrant/docs/multi-machine