Vagrantfile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # All Vagrant configuration is done below. The "2" in Vagrant.configure
  4. # configures the configuration version (we support older styles for
  5. # backwards compatibility). Please don't change it unless you know what
  6. # you're doing.
  7. Vagrant.configure("2") do |config|
  8. # config.vm.provider :aws do |aws, override|
  9. # config.vm.box = "dummy"
  10. # config.vm.synced_folder ".", "/vagrant", disabled: true
  11. # aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
  12. # aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
  13. # aws.region = 'us-east-1'
  14. # aws.keypair_name = 'box'
  15. # aws.region_config "us-east-1", :ami => "ami-zzzzz"
  16. # aws.instance_type = 'm4.large'
  17. # aws.elastic_ip = '127.0.0.1'
  18. # aws.subnet_id = 'subnet-xxxxxx'
  19. # aws.security_groups = ['sg-xxxx', 'sg-zzzzzc']
  20. # aws.ami = 'ami-xxxx'
  21. # aws.ssh_host_attribute = :public_ip_address
  22. # override.ssh.pty = true
  23. # override.ssh.username = 'ubuntu'
  24. # override.ssh.private_key_path = '/Users/machine/.ssh/box.pem'
  25. # end
  26. #
  27. # config.vm.provider :digital_ocean do |provider, override|
  28. # override.ssh.private_key_path = '~/.ssh/id_rsa'
  29. # override.vm.box = 'digital_ocean'
  30. # override.vm.box_url = "https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box"
  31. # provider.token = ENV['DIGITALOCEAN_TOKEN']
  32. # provider.image = 'ubuntu-14-04-x64'
  33. # provider.region = 'nyc3'
  34. # provider.size = '2gb'
  35. # end
  36. #
  37. config.vm.box = "ubuntu/trusty64"
  38. config.vm.network "private_network", ip: "192.168.88.10"
  39. config.vm.hostname = "app.local"
  40. config.vm.network "public_network"
  41. config.vm.provider "virtualbox" do |vb|
  42. vb.gui = false
  43. vb.memory = "4096"
  44. vb.cpus = "2"
  45. end
  46. $script = <<SCRIPT
  47. #!/bin/bash -ex
  48. export RAILS_ENV=production
  49. export RACK_ENV=production
  50. exit 0
  51. SCRIPT
  52. config.vm.provision "shell", inline: $script
  53. config.vm.provision "ansible" do |ansible|
  54. ansible.verbose = true
  55. ansible.playbook = 'site.yml'
  56. ansible.inventory_path = "./hosts"
  57. ansible.limit = 'local'
  58. # ansible.limit = 'digitalocean'
  59. # ansible.limit = 'aws'
  60. end
  61. end