Thanks for the recommendations on the workaround, I will try it. Any reason 
you split these out over 2 different blocks?

I definitely see now how what I was doing was wrong with config vs 
override; this is one of those goofy errors due to closure. It's very 
subtle. Many rubyists have seen this code and no one even noticed the 
error. Thinking about it more I am not sure that you could really produce 
warnings for this case unless you decide to just mask "config" since people 
use it by convention; but AFAIK it's just a plain-old closure bug.

On Thursday, February 6, 2014 1:48:09 PM UTC-5, Alvaro Miranda Aguilera 
wrote:
>
> Ok, so the issue of 3 networks can be resolved by:
>
>   config.vm.provider :virtualbox do |vb, override|                            
>                                                                               
>                                   
>     override.vm.box     = 'Tourbuzz_Basebox_centos_65'                        
>                                                                               
>                                   
>     override.vm.box_url = 
> 'https://s3.amazonaws.com/util.cloud.tourbuzz.net/base_boxes/opscode_centos-6.5_chef-11.8.2.box'
>                                                                     
>                                                                               
>                                                                               
>                                       # private network gives a static IP; 
> ideal for juggling multiple machines                                          
>                                                                        
>     override.vm.network :private_network, ip: $vagrant[:network]              
>                                                                               
>                                   
>   end                                                                         
>                                                                               
>                                   
>
>   config.vm.provider :virtualbox do |vb|                                      
>                                                                               
>                                   
>                                                                               
>                                                                               
>                                       vb.gui  = $vagrant[:gui]                
>                                                                               
>                                                                     
>     vb.name = $vagrant[:vm_name] if $vagrant[:vm_name]                        
>                                                                               
>                                   
>                                                                               
>                                                                               
>                                       vb.customize ["modifyvm", :id, 
> "--memory",              $vagrant[:memory_size]  ]                            
>                                                                              
>     # enable multi-cpu shit                                                   
>                                                                               
>                                   
>     vb.customize ['modifyvm', :id, "--cpus",                $vagrant[:cpus]   
>       ]                                                                       
>                                   
>     vb.customize ["modifyvm", :id, "--ioapic",              $vagrant[:ioapic] 
>       ]  # this is buggy, crashes on some machines. if you have issues turn 
> it off in Vagrantfile.local.rb      
>                                                                               
>                                                                               
>                                       # makes DNS work correctly (fast)       
>                                                                               
>                                                                     
>     vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"              
>       ]                                                                       
>                                   
>   end                                                                         
>                                                                               
>                                   
>
>
> Tested, and works cool.
>
> Thanks to Teemu. 
>
>
>
> On Fri, Feb 7, 2014 at 2:42 AM, Teemu Matilainen 
> <[email protected]<javascript:>
> > wrote:
>
>> Hi Alan,
>>
>> On Thu, Feb 6, 2014 at 1:19 AM, Alan Pinstein <[email protected]<javascript:>
>> > wrote:
>>
>>>
>>>    - 
>>>    As a user I don't expect placing network config to be handled 
>>>    differently when placed in a global config block vs a provider config 
>>>    block, esp since vagrant seems to be heading in a direction where one 
>>> would 
>>>    use it to configure the same box across different providers (dev on 
>>> VBox, 
>>>    prod on AWS for instance), being able to have per-provider network 
>>> config 
>>>    work gracefully would seem to be the goal. 
>>>
>>>
>> This is totally supported. But you have to use the `override` variable in 
>> the `provider` block. See "Overriding Configuration" in the docs: 
>> http://docs.vagrantup.com/v2/providers/configuration.html
>>  
>> -- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.

Reply via email to