Pierluigi Vernetto
Pierluigi Vernetto

Reputation: 2050

How to "vagrant up" multiple nodes at a time?

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...

Upvotes: 2

Views: 1107

Answers (1)

Emyl
Emyl

Reputation: 10536

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.

Upvotes: 1

Related Questions