Vagrantfile.example 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/28/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-28-1.1.x86_64.vagrant-libvirt.box"
  6. config.vm.box = "f28-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 "ansible" do |ansible|
  37. ansible.playbook = "dev/ansible/vagrant-playbook.yml"
  38. end
  39. # Create the "pagure" box
  40. config.vm.define "pagure" do |pagure|
  41. pagure.vm.host_name = "pagure-dev.example.com"
  42. pagure.vm.provider :libvirt do |domain|
  43. # Season to taste
  44. domain.cpus = 4
  45. domain.graphics_type = "spice"
  46. domain.memory = 2048
  47. domain.video_type = "qxl"
  48. # Uncomment the following line if you would like to enable libvirt's unsafe cache
  49. # mode. It is called unsafe for a reason, as it causes the virtual host to ignore all
  50. # fsync() calls from the guest. Only do this if you are comfortable with the possibility of
  51. # your development guest becoming corrupted (in which case you should only need to do a
  52. # vagrant destroy and vagrant up to get a new one).
  53. #
  54. # domain.volume_cache = "unsafe"
  55. end
  56. end
  57. end