Ingen beskrivning
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Vagrantfile 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. 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