Vagrantfile.example 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. VAGRANTFILE_API_VERSION = "2"
  4. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  5. config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/25/CloudImages/x86_64/images/Fedora-Cloud-Base-Vagrant-25-1.3.x86_64.vagrant-libvirt.box"
  6. config.vm.box = "f25-cloud-libvirt"
  7. # Forward traffic on the host to the development server on the guest
  8. config.vm.network "forwarded_port", guest: 5000, host: 5000
  9. # Forward traffic on the host to Redis on the guest
  10. config.vm.network "forwarded_port", guest: 6379, host: 6379
  11. # Forward traffic on the host to the SSE server on the guest
  12. config.vm.network "forwarded_port", guest: 8080, host: 8080
  13. if Vagrant.has_plugin?("vagrant-hostmanager")
  14. config.hostmanager.enabled = true
  15. config.hostmanager.manage_host = true
  16. end
  17. # Vagrant can share the source directory using rsync, NFS, or SSHFS (with the vagrant-sshfs
  18. # plugin). By default it rsyncs the current working directory to /vagrant.
  19. #
  20. # If you would prefer to use NFS to share the directory uncomment this and configure NFS
  21. # config.vm.synced_folder ".", "/vagrant", type: "nfs", nfs_version: 4, nfs_udp: false
  22. config.vm.synced_folder ".", "/vagrant", disabled: true
  23. config.vm.synced_folder ".", "/home/vagrant/devel",
  24. type: "sshfs",
  25. sshfs_opts_append: "-o nonempty"
  26. # To cache update packages (which is helpful if frequently doing `vagrant destroy && vagrant up`)
  27. # you can create a local directory and share it to the guest's DNF cache. The directory needs to
  28. # exist, so create it before you uncomment the line below.
  29. #Dir.mkdir('.dnf-cache') unless File.exists?('.dnf-cache')
  30. #config.vm.synced_folder ".dnf-cache", "/var/cache/dnf",
  31. # type: "sshfs",
  32. # sshfs_opts_append: "-o nonempty"
  33. # Comment this line if you would like to disable the automatic update during provisioning
  34. config.vm.provision "shell", inline: "sudo dnf upgrade -y"
  35. # bootstrap and run with ansible
  36. config.vm.provision "shell", inline: "sudo dnf -y install python2-dnf libselinux-python"
  37. config.vm.provision "ansible" do |ansible|
  38. ansible.playbook = "dev/ansible/vagrant-playbook.yml"
  39. end
  40. # Create the "pagure" box
  41. config.vm.define "pagure" do |pagure|
  42. pagure.vm.host_name = "pagure-dev.example.com"
  43. pagure.vm.provider :libvirt do |domain|
  44. # Season to taste
  45. domain.cpus = 4
  46. domain.graphics_type = "spice"
  47. domain.memory = 2048
  48. domain.video_type = "qxl"
  49. # Uncomment the following line if you would like to enable libvirt's unsafe cache
  50. # mode. It is called unsafe for a reason, as it causes the virtual host to ignore all
  51. # fsync() calls from the guest. Only do this if you are comfortable with the possibility of
  52. # your development guest becoming corrupted (in which case you should only need to do a
  53. # vagrant destroy and vagrant up to get a new one).
  54. #
  55. # domain.volume_cache = "unsafe"
  56. end
  57. end
  58. end