if <PROVIDER IS AWS>
if File.exist?("aws.yml")
aws_config = YAML.load_file('aws.yml')["aws"]
else
puts "Required file aws.yml is missing"
exit
end
end
No
--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/XIxGdm78s4I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
config.vm.provider ... do |...|end
config.vm.provider :vmware_fusion do |vmware|puts "vmware_fusion!!!!"
endconfig.vm.provider :virtualbox do |vbox|
puts "virtualbox!!!"end
It seems to me that what is happening is that Vagrant is processing the entire Vagrantfile in order to build the possible configuration objects.vmware_fusion!!!!virtualbox!!!vmware_fusion!!!!virtualbox!!!vmware_fusion!!!!virtualbox!!!Bringing machine 'default' up with 'virtualbox' provider...
--
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 vagrant-up+...@googlegroups.com.
You can put something like this in your Vagrantfile:provider = (ARGV[2] || :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.
--
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 vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# Workaround for mitchellh/vagrant#1867
if ARGV[1] and \
(ARGV[1].split('=')[0] == "--provider" or ARGV[2])
provider = (ARGV[1].split('=')[1] || ARGV[2])
else
provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
end
puts "Detected #{provider}"
if provider == "aws"
puts 'If you want to use the AWS provider, you must provide these variables: '
<code snip>
end
VAGRANT_DEFAULT_PROVIDER=lxc vagrant destroy -f
vagrant up --provider=virtualbox
VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up
if provider == :aws puts 'If you want to use the AWS provider, you must provide these variables: '
<code snip>
end