Advertisement
lenkaseg

Vagrantfile

Sep 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. VAGRANTFILE_API_VERSION = "2"
  5.  
  6. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  7. config.vm.box_url = "http://ftp.cica.es/fedora/linux/releases/28/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-28-1.1.x86_64.vagrant-libvirt.box"
  8. config.vm.box = "f28-cloud-libvirt"
  9.  
  10.  
  11. # Forward traffic on the host to the development server on the guest
  12. config.vm.network "forwarded_port", guest: 5000, host: 5000
  13. # Forward traffic on the host to Redis on the guest
  14. config.vm.network "forwarded_port", guest: 6379, host: 6379
  15. # Forward traffic on the host to the SSE server on the guest
  16. config.vm.network "forwarded_port", guest: 8080, host: 8080
  17.  
  18. if Vagrant.has_plugin?("vagrant-hostmanager")
  19. config.hostmanager.enabled = true
  20. config.hostmanager.manage_host = true
  21. end
  22.  
  23. # Vagrant can share the source directory using rsync, NFS, or SSHFS (with the vagrant-sshfs
  24. # plugin). By default it rsyncs the current working directory to /vagrant.
  25. #
  26. # If you would prefer to use NFS to share the directory uncomment this and configure NFS
  27. # config.vm.synced_folder ".", "/vagrant", type: "nfs", nfs_version: 4, nfs_udp: false
  28. config.vm.synced_folder ".", "/vagrant", disabled: true
  29. config.vm.synced_folder ".", "/home/vagrant/devel",
  30. type: "sshfs",
  31. sshfs_opts_append: "-o nonempty"
  32.  
  33. # To cache update packages (which is helpful if frequently doing `vagrant destroy && vagrant up`)
  34. # you can create a local directory and share it to the guest's DNF cache. The directory needs to
  35. # exist, so create it before you uncomment the line below.
  36. #Dir.mkdir('.dnf-cache') unless File.exists?('.dnf-cache')
  37. #config.vm.synced_folder ".dnf-cache", "/var/cache/dnf",
  38. # type: "sshfs",
  39. # sshfs_opts_append: "-o nonempty"
  40.  
  41. # Comment this line if you would like to disable the automatic update during provisioning
  42. config.vm.provision "shell", inline: "sudo dnf upgrade -y"
  43.  
  44. # bootstrap and run with ansible
  45. #
  46. config.vm.provision "shell", inline: "sudo dnf -y install python2-dnf libselinux-python"
  47. config.vm.provision "ansible" do |ansible|
  48. ansible.playbook = "dev/ansible/vagrant-playbook.yml"
  49. end
  50.  
  51.  
  52. # Create the "pagure" box
  53. config.vm.define "pagure" do |pagure|
  54. pagure.vm.host_name = "pagure-dev.example.com"
  55. # adding the private network
  56. pagure.vm.network :private_network,
  57. :type => "dhcp",
  58. :libvirt_network_address => '10.11.12.0'
  59.  
  60. pagure.vm.provider :libvirt do |domain|
  61. # Season to taste
  62. domain.cpus = 4
  63. domain.graphics_type = "spice"
  64. domain.memory = 2048
  65. domain.video_type = "qxl"
  66.  
  67. # Uncomment the following line if you would like to enable libvirt's unsafe cache
  68. # mode. It is called unsafe for a reason, as it causes the virtual host to ignore all
  69. # fsync() calls from the guest. Only do this if you are comfortable with the possibility of
  70. # your development guest becoming corrupted (in which case you should only need to do a
  71. # vagrant destroy and vagrant up to get a new one).
  72. #
  73. # domain.volume_cache = "unsafe"
  74. end
  75. end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement