# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. VAGRANTFILE_API_VERSION = "2" BOX = "centos/7" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Configure VM RAM and CPU for VirtualBox. Change this to meet your needs. config.vm.provider :virtualbox do |virtualbox, override| virtualbox.memory = 2048 virtualbox.cpus = 2 override.vm.box = BOX end # Configure VM RAM and CPU for LibVirt. Change this to meet your needs. config.vm.provider :libvirt do |libvirt, override| libvirt.memory = 2048 libvirt.cpus = 2 override.vm.box = BOX end config.vm.provider "docker" do |docker, override| docker.build_dir = "." docker.remains_running = false override.vm.synced_folder ".", "/build" end # NFS is fragile, use rsync config.vm.synced_folder ".", "/vagrant", type: "rsync" config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true # Add EPEL for access to fedora-packager and maybe others config.vm.provision "shell", inline: "yum install -y epel-release" # Install required software # fedora-packager: Basic RPM packaging software config.vm.provision "shell", inline: "yum install -y fedora-packager \ python-pip" # Use the distribution's version of pip to upgrade to the latest pip config.vm.provision "shell", inline: "pip install --upgrade pip" # Install Python dependences system-wide via pip # NB: Could use a venv here, but since we're already in a Vagrant box and # don't need any more isolation, it doesn't seem worth the extra complexity. config.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt" # Add vagrant user to mock group for rpmbuild config.vm.provision "shell", inline: "sudo usermod -a -G mock vagrant" end