Vagrantfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. #
  4. Vagrant.configure("2") do |config|
  5. # This is going to mount your ~/Code directory
  6. config.vm.synced_folder "~/Code", "/home/vagrant/Code"
  7. # Forwarding Ports - you should add any necessary ports here
  8. config.vm.network "forwarded_port", guest: 2112, host: 2112
  9. # Mount the ansible dirs here and your ssh directory so we
  10. # can copy over your ssh keys so they can be use for code sync
  11. config.vm.synced_folder "ansible/", "/etc/ansible"
  12. config.vm.synced_folder "~/.ssh", "/home/vagrant/.ssh.new"
  13. # Grab the latest OS and install and configure Ansible
  14. config.vm.provision "shell", inline: "/bin/bash /etc/ansible/setup.sh"
  15. config.vm.box = "ubuntu/trusty64"
  16. config.vm.hostname = "ansible-devbox"
  17. config.vm.provider "virtualbox" do |v|
  18. v.memory = 1024
  19. v.cpus = 1
  20. end
  21. # Re-download all of the modules in the requirements.yml file
  22. # *DANGER* do not store anything in the roles directory
  23. config.vm.provision "shell", inline: "cd /etc/ansible && rm -rf roles/* && ansible-galaxy install --roles-path roles -r requirements.yml"
  24. config.vm.provision "shell", inline: "/usr/local/bin/ansible-playbook /etc/ansible/playbook.yml"
  25. end