Allow setting of general config inside provider block #1535

Floppy opened this Issue Apr 3, 2013 · 3 comments

2 participants


We need to change settings such as ssh_username, private key path and box name based on provider in one Vagrantfile. Unfortunately at the moment we can't change general config variables from within the provider block (unless the provider exposes them explicitly). It would be great to be able to set any config from with the provider block, or detect the provider in some way.

For instance, maybe something like this:

    vagrant.vm.define vm_name do |config|
      # Instead of doing this here
      # = 'precise64'

      # Do it inside here:
      config.vm.provider :rackspace do |rs| = 'dummy'
        ... provider-specific config
      config.vm.provider :virtualbox do |vb| = 'precise64'
        ... provider-specific config

It may well be that we're going about this wrong - I'm definitely open to a better way of doing this.


Dup of #1523. Check that out for more info.

@mitchellh mitchellh closed this Apr 3, 2013

Thanks, I hadn't seen that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment