No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Vagrantfile 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # If you're having issues, upgrade to Vagrant 1.3.x. It generates an inventory automatically:
  2. # https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md#130-september-5-2013
  3. Vagrant.configure('2') do |config|
  4. config.vm.provider :lxc do |lxc, override|
  5. override.vm.box = 'precise64'
  6. override.vm.box_url = 'http://bit.ly/vagrant-lxc-precise64-2013-05-08'
  7. end
  8. config.vm.provider :virtualbox do |vbox, override|
  9. override.vm.box = 'precise64'
  10. override.vm.box_url = 'http://files.vagrantup.com/precise64.box'
  11. end
  12. boxes = [
  13. {
  14. :name => 'ansible.local',
  15. :forwards => { 22 => 22222,
  16. 80 => 80,
  17. 25 => 25,
  18. 143 => 143,
  19. 465 => 465,
  20. 993 => 993 }
  21. }
  22. ]
  23. boxes.each do |opts|
  24. config.vm.hostname = opts[:name]
  25. opts[:forwards].each do |guest_port, host_port|
  26. config.vm.network :forwarded_port, :guest => guest_port, :host => host_port
  27. end
  28. config.vm.provision :shell,
  29. :inline => 'if [ ! -e /root/apt.updated ]; then apt-get update && touch /root/apt.updated ; fi; apt-get install -y python-apt'
  30. config.vm.provision :ansible do |ansible|
  31. ansible.playbook = 'site.yml'
  32. end
  33. config.vm.provision :shell,
  34. :inline => "echo [test] > /vagrant/hosts.autogen && ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 >> /vagrant/hosts.autogen"
  35. end
  36. end