You could also check the provider type from with the provider block, and 
set up some conditional config there:


  config.vm.provider "digital_ocean" do |provider|

    puts "* Using Digital Ocean Provider *"
    config.ssh.private_key_path = "~/.ssh/id_rsa" if provider.is_a? 
VagrantPlugins::DigitalOcean::Config

    provider.client_id = DIGITAL_OCEAN_CLIENT_ID
    provider.api_key = DIGITAL_OCEAN_API_KEY
    provider.image = "Ubuntu 13.10 x64"
    provider.region = "San Francisco 1"
  end



On Tuesday, November 12, 2013 9:14:14 AM UTC-8, Teemu Matilainen wrote:
>
> On Tue, Nov 12, 2013 at 1:39 PM, Shawn Neal <[email protected]<javascript:>
> > wrote:
>
>> You can put something like this in your Vagrantfile:
>>
>>   provider = (ARGV[2] || :virtualbox).to_sym
>>
>
> The default provider can also be set by an environment variable:
>
> provider = (ARGV[2] || ENV['VAGRANT_DEFAULT_PROVIDER'] || 
> :virtualbox).to_sym
>  
>
>> While this works, I tend to avoid doing things like this. Instead I put 
>> things like this into a config file that is conditionally loaded if they 
>> exist or in environment variables.
>>
>
> Yeah, that feels really fragile. =)
>
> -- 
> Cheers,
>   Teemu 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to