Skip to content
Snippets Groups Projects
Select Git revision
  • 454087d50efdd06bf30967e3784e49975a11c1f6
  • master default
2 results

Vagrantfile

Blame
  • user avatar
    Jeremy Guiselin authored
    92a9219c
    History
    Vagrantfile 1.47 KiB
    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    
    VAGRANTFILE_API_VERSION = "2"
    
    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    
     config.vm.define "betskills"
    
     config.vm.box = "ubuntu/trusty64"
     config.vm.box_url = "https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20150516.0.0/providers/virtualbox.box"
    
     config.vm.network "private_network", ip: "192.168.33.11"
     config.vm.network :forwarded_port, guest: 80, host: 8888
     config.vm.hostname = "backend.betskills.dev"
    
     config.vm.synced_folder ".", "/vagrant", disabled: true
     config.vm.synced_folder ".", "/var/www/betskills/backend/", id: "vagrant-root", :owner=> 'www-data', :mount_options => ['dmode=775', 'fmode=775']
    
     config.vm.provider :virtualbox do |vb|
       vb.gui = false
       vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
     end
    
     # http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html
     config.vm.provision "fix-no-tty", type: "shell" do |s|
        s.privileged = false
        s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
     end
    
     # automatically cd to project dir on login
     config.vm.provision :shell, inline: "echo 'cd /var/www/betskills/backend/' > /home/vagrant/.bashrc"
    
    
     config.vm.provision :ansible do |ansible|
       ansible.raw_arguments = ['--timeout=300']
       ansible.playbook = ".ansible/project.yml"
       ansible.verbose = "vvv"
       ansible.groups = {
         "env-dev:children" => ["app-web", "app-db"],
         "app-web" => ["betskills"],
         "app-db" => ["betskills"],
       }
     end
    
    end