4 # Vagrantfile API/syntax version.
5 VAGRANTFILE_API_VERSION = "2"
7 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8 # RPM build environment is CentOS 7
9 config.vm.box = "centos/7"
11 # Configure VM RAM and CPU for VirtualBox. Change this to meet your needs.
12 config.vm.provider :virtualbox do |virtualbox|
13 virtualbox.memory = 2048
17 # Configure VM RAM and CPU for LibVirt. Change this to meet your needs.
18 config.vm.provider :libvirt do |libvirt|
23 # NFS is fragile, use rsync
24 config.vm.synced_folder ".", "/vagrant", type: "rsync"
25 config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
27 # Add EPEL for access to fedora-packager and maybe others
28 config.vm.provision "shell", inline: "yum install -y epel-release"
30 # Install required software
31 # fedora-packager: Basic RPM packaging software
32 config.vm.provision "shell", inline: "yum install -y fedora-packager \
35 # Use the distribution's version of pip to upgrade to the latest pip
36 config.vm.provision "shell", inline: "pip install --upgrade pip"
38 # Install Python dependences system-wide via pip
39 # NB: Could use a venv here, but since we're already in a Vagrant box and
40 # don't need any more isolation, it doesn't seem worth the extra complexity.
41 config.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt"
43 # Add vagrant user to mock group for rpmbuild
44 config.vm.provision "shell", inline: "sudo usermod -a -G mock vagrant"