vagrantfile - How to group multiple vagrant machines into one environment and another group of machines as another environment? -
hi lets have 4 machines defined in vagrantfile (this example),
vagrant.configure(2) |config| config.vm.define "elasticsearch" |a| a.vm.provider "docker" |docker| docker.name = 'elasticsearch' docker.build_dir = ".docker/elasticsearch" end end config.vm.define "elasticsearch-test" |a| a.vm.provider "docker" |docker| docker.name = 'elasticsearch-test' docker.build_dir = ".docker/elasticsearch" end end config.vm.define "mongodb" |a| a.vm.provider "docker" |docker| docker.name = 'mongodb' docker.image = "mongo:3.0" end end config.vm.define "mongodb-test" |a| a.vm.provider "docker" |docker| docker.name = 'mongodb-test' docker.image = "mongo:3.0" end end end
and want group elasticsearch
, mongodb
"dev env"
and want group elasticsearch-test
, mongodb-test
"test env"
then want able run single command bring env want work now. e. g.:
vagrant "dev env"
how do this? not find such thing in vagrant docs. how approach problem? should create different vagrantfile in subdirectory of project , define machines per environment?
Comments
Post a Comment