Allow setting of general config inside provider block #1535

Closed
Floppy opened this Issue Apr 3, 2013 · 3 comments

2 participants

@Floppy

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
      # config.vm.box = 'precise64'

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

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

@mitchellh
Owner

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

@mitchellh mitchellh closed this Apr 3, 2013
@Floppy

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