1
0

Vagrantfile.example 2.7 KB

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