Geen omschrijving
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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # The following patch needs to be applied for ansible to run cleanly on vagrant up:
  2. # https://github.com/mitchellh/vagrant/pull/1723.diff on /opt/vagrant/embedded/gems/gems/vagrant-1.2.x
  3. $boxes = [
  4. {
  5. :name => 'ansible.local',
  6. :forwards => { 22 => 22222,
  7. 80 => 80,
  8. 25 => 25,
  9. 143 => 143,
  10. 465 => 465,
  11. 993 => 993
  12. }
  13. }
  14. ]
  15. Vagrant.configure('2') do |config|
  16. config.vm.provider :lxc do |lxc, override|
  17. override.vm.box = 'precise64'
  18. override.vm.box_url = 'http://bit.ly/vagrant-lxc-precise64-2013-05-08'
  19. end
  20. config.vm.provider :virtualbox do |vbox, override|
  21. override.vm.box = 'precise64'
  22. override.vm.box_url = 'http://files.vagrantup.com/precise64.box'
  23. end
  24. $boxes.each do |opts|
  25. config.vm.hostname = opts[:name]
  26. opts[:forwards].each do |guest_port, host_port|
  27. config.vm.network :forwarded_port, :guest => guest_port, :host => host_port
  28. end
  29. config.vm.provision :shell,
  30. :inline => 'if [ ! -e /root/apt.updated ]; then apt-get update && touch /root/apt.updated ; fi; apt-get install -y python-apt'
  31. config.vm.provision :ansible do |ansible|
  32. ansible.playbook = 'site.yml'
  33. end
  34. config.vm.provision :shell,
  35. :inline => "echo [test] > /vagrant/hosts.autogen && ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 >> /vagrant/hosts.autogen"
  36. end
  37. end