Vagrantfile.example 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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/30/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-30-1.2.x86_64.vagrant-libvirt.box"
  6. config.vm.box = "f30-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 ".", "/srv/pagure",
  24. type: "sshfs"
  25. # To cache update packages (which is helpful if frequently doing `vagrant destroy && vagrant up`)
  26. # you can create a local directory and share it to the guest's DNF cache. The directory needs to
  27. # exist, so create it before you uncomment the line below.
  28. #Dir.mkdir('.dnf-cache') unless File.exists?('.dnf-cache')
  29. #config.vm.synced_folder ".dnf-cache", "/var/cache/dnf",
  30. # type: "sshfs",
  31. # sshfs_opts_append: "-o nonempty"
  32. # Comment this line if you would like to disable the automatic update during provisioning
  33. config.vm.provision "shell", inline: "sudo dnf upgrade -y || true"
  34. # bootstrap and run with ansible
  35. config.vm.provision "ansible" do |ansible|
  36. ansible.playbook = "dev/ansible/vagrant-playbook.yml"
  37. end
  38. # Create the "pagure" box
  39. config.vm.define "pagure" do |pagure|
  40. pagure.vm.host_name = "pagure-dev.example.com"
  41. pagure.vm.provider :libvirt do |domain|
  42. # Season to taste
  43. domain.cpus = 4
  44. domain.graphics_type = "spice"
  45. domain.memory = 3072
  46. domain.video_type = "qxl"
  47. # Uncomment the following line if you would like to enable libvirt's unsafe cache
  48. # mode. It is called unsafe for a reason, as it causes the virtual host to ignore all
  49. # fsync() calls from the guest. Only do this if you are comfortable with the possibility of
  50. # your development guest becoming corrupted (in which case you should only need to do a
  51. # vagrant destroy and vagrant up to get a new one).
  52. #
  53. # domain.volume_cache = "unsafe"
  54. end
  55. end
  56. end