Reputation: 55
I have a Vagrant project in a Git repository, but require different Vagrant files for various machines. I'm wondering if there is a way to manage the Vagrant file in Git, rather than having to .gitignore the file and manage them outside of Git.
Upvotes: 0
Views: 124
Reputation: 11628
I would have different Vagrant files with their machine name appended to the filenames. Such as: Vagrant.staging
, Vagrant.development
, Vagrant.production
, etc. When you go to deploy, just symlink the relative one to Vagrant.
Upvotes: 0
Reputation: 18049
It's usually a really good idea to put your Vagrantfile in source control, since it is often part of your dev and/or test environment.
It sounds like your problem is that each machine needs to make some customizations to the Vagrantfile to make it fit into their environment. This is a common issue – managing configuration files in source control. There's two main approaches:
ENV
. This way, you can commit the Vagrantfile and just require end users to configure their environment.Upvotes: 1