vagrant - Specify default provider in Vagrantfile -
I want to specify directly in the vagrantfile which the provider has to use for each VM by default.
For example, this is given to the vagrantfile:
# wgetratefile [...] config.vm.define 'Dev_vm' do | Machine | Machine.vm.provider: libvirt do | Os | [...] End # machine.default_provider =: libvirt end config.vm.define 'production_vm' do | Machine | Machine.vm.provider: OpenStock Do | OS | [...] End # machine.default_provider =: openstack end
To boot the VMS, I will need to issue two commands at present:
Elite up --provider = libvirt dev_vm vagrant up --provider = openstack production_vm
I have a single elite with both Up
, especially because I'm running a lot of machines, it would be great to have some configuration like machine.default_provider =: OpenStock
.
What is the way to do this?
I do not think there is any easy way to do this. Wagints will currently use the same provider throughout the run, so potentially it may be a big code change to support this.
Perhaps the wrapper script is now the easiest solution.
Use different WOGFILES for another solution VM and set VAGRANT_DEFAULT_PROVIDER
in each If you have many common configs, then you can generate it like Wiggart File Com
, which is included by some others:
# Vagrantfile 1 ENV ['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt' # value is in the default config root directory file.expand_path ('../../ Vagrantfile.common', __FILE__) Vagrant.configure ('2') do | Config | # ... end
Comments
Post a Comment