Created
September 23, 2015 15:33
-
-
Save andrewsomething/0ef79c494f702ef86dd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
config.ssh.private_key_path = 'sshkey/id_rsa' | |
config.vm.box ='ubuntu/trusty64' | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
provider_is_do = (!ARGV.nil? && ARGV.join('').include?('provider=digital_ocean')) | |
config.vm.provision 'shell', inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y nginx | |
SHELL | |
config.vm.define 'web' do |web| | |
web.vm.provider :virtualbox do |vbox| | |
vbox.customize ['modifyvm', :id, '--memory', 1024] | |
end | |
if provider_is_do | |
web.vm.provider :digital_ocean do |docean, override| | |
config.vm.box = 'digital_ocean' | |
config.vm.box_url = 'https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box' | |
docean.token = ENV['DO_TOKEN'] | |
docean.image = 'ubuntu-14-04-x64' | |
docean.region = 'nyc3' | |
docean.size = '1gb' | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment