frlan
frlan

Reputation: 7270

Vagrant: How to configure vagrant to use different Vagrantfiles

How to use Vagrant for testing e.g. an application running on a Debian, Ubuntu, SuSE etc. VM.

Current project is having one Vagrantfile having configuration inside. To start the Vagrant VM I'm running

vagrant up
vagrant provision

Now I'm wondering how to do something like

vagrant up suse ... and later vagrant up debian

Upvotes: 3

Views: 2192

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53793

you can do one of the following:

  1. having git with different branch and the Vagrantfile will be different depending your branch. Be careful though as your .vagrant directory will not match your Vagrantfile, you will need to up and provision each VM and switch the .vagrant directory.

  2. you can use vagrant multi machine generally you use that to reproduce a multi-tier environment so each VM can be up and running at same time, but you can provision and up each VM independently

  3. really use different project folder with each a specific Vagrantfile and a .vagrant directory, each for a specific purpose

Upvotes: 2

Related Questions