How to “vagrant up” multiple nodes at a time?

允我心安 提交于 2019-12-11 04:14:36

问题


I have a Vagrantfile with multiple nodes defined - say node1, node2, node3.

I want to run a single command

"vagrant up --provision node1,node2"

but this doesn't seem to be possible in one command line, the only way seems to run 2 commands in parallel:

"vagrant up --provision node1"
"vagrant up --provision node2"

Anybody has a workaround to suggest?

A Vagrantfile is a Ruby script, so maybe enriching it with some syntax can get the job done... but I have no Ruby skills...


回答1:


You can use a regular expression for choosing which machines you want to operate to. So in your case:

vagrant up --provision /node[1-2]/

Should work.



来源:https://stackoverflow.com/questions/23995757/how-to-vagrant-up-multiple-nodes-at-a-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!