# -*- mode: ruby -*- # vi: set ft=ruby : # This is a set of different vagrant setups that are primarily useful for package # building and testing. The techniques here were borrowed from the Git Fusion # team. VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| #General Centos VM config.vm.define 'centos6.5' do |vagrant| vagrant.vm.hostname = 'centos6.5' vagrant.vm.box = "grtjn/centos-6.5" vagrant.vm.network :private_network, ip: '172.16.100.14' vagrant.vm.synced_folder '.', '/home/vagrant/hws' vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/centos_basic.sh" end #Generic ubuntu machine config.vm.define 'ubuntu_12' do |vagrant| vagrant.vm.hostname = 'test-ubuntu12' vagrant.vm.box = 'precise64' vagrant.vm.box_url = 'http://files.vagrantup.com/precise64.box' # vagrant.vm.network :private_network, ip: '172.16.100.11' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.network :public_network #vagrant.vm.network :private_network vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_helix_vb.sh" end #GF 15.1 machine for testing config.vm.define 'gitfusion_15.1' do |vagrant| vagrant.vm.hostname = 'gitfusion' vagrant.vm.box = 'ubuntu/precise64' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false #vagrant.vm.network :private_network, ip: '172.16.100.12' vagrant.vm.network "public_network" vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_15.1.sh" end #A VM for GitSwarm15.3 and beyond. config.vm.define 'gitswarm' do |vagrant| vagrant.vm.hostname = 'gitswarmvm' vagrant.vm.box = "bento/ubuntu-16.04" # vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.network :public_network vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 9096 end vagrant.vm.provision "shell", path: "linux/setup_gitswarm.sh" end #A VM for running P4 and P4D, as well as acting as a potential Jenkins slave machine. config.vm.define 'basic' do |vagrant| vagrant.vm.hostname = 'basic' vagrant.vm.box = "bento/ubuntu-16.04" vagrant.vm.communicator = "ssh" config.ssh.keys_only = true config.ssh.insert_key=true # vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.network :public_network vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_p4d.sh" end #A VM for just running Git Fusion. config.vm.define 'gf_stand_alone' do |vagrant| vagrant.vm.hostname = 'gf' vagrant.vm.box = 'ubuntu/precise64' # vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.network :public_network vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_helix_vb.sh" end #VMs for GitSwarm, which connects to a VM running GitFusion and P4D. config.vm.define 'gitswarm_stand_alone' do |vagrant| vagrant.vm.hostname = 'gitswarmvm' vagrant.vm.box = 'ubuntu/precise64' vagrant.vm.network :private_network, ip: '172.16.100.12' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_gitswarm.sh" end #FreeBSD10 VM config.vm.define 'freebsd10' do |config| config.vm.guest = :freebsd config.vm.synced_folder '.', '/home/vagrant/hws' config.vm.box = "freebsd/FreeBSD-10.2-STABLE" config.ssh.shell = "sh" config.vm.base_mac = "080027D14C66" config.ssh.insert_key=false config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "1024"] vb.customize ["modifyvm", :id, "--cpus", "1"] vb.customize ["modifyvm", :id, "--hwvirtex", "on"] vb.customize ["modifyvm", :id, "--audio", "none"] vb.customize ["modifyvm", :id, "--nictype1", "virtio"] vb.customize ["modifyvm", :id, "--nictype2", "virtio"] end end #A VM for an LDAP server, setup from scratch: config.vm.define 'ldap2' do |vagrant| vagrant.vm.hostname = 'ldaptest' vagrant.vm.box = 'ubuntu/trusty64' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false # vagrant.vm.network :public_network vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end end #Git Fusion for http set up after installation tests. config.vm.define 'gitfusion_test' do |vagrant| vagrant.vm.hostname = 'gitfusion' vagrant.vm.box = 'ubuntu/trusty64' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.network :private_network, ip: '172.16.100.14' # vagrant.vm.network :public_network vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_helix_nohttps.sh" end #For GitSwarm EE config.vm.define 'gitswarm_ee' do |vagrant| vagrant.vm.hostname = 'gitswarm-ee' vagrant.vm.box = 'ubuntu/trusty64' # vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.network :public_network vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/gitswarm_ee.sh" end #For Swarm and Jenkins config.vm.define 'cd' do |vagrant| vagrant.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" vagrant.vm.box = "ubuntu/trusty64" if Vagrant.has_plugin?("vagrant-cachier") vagrant.cache.scope = :box end vagrant.vm.hostname = 'cd' vagrant.vm.box_url = "ubuntu/trusty64" vagrant.vm.network "public_network" vagrant.vm.provider "virtualbox" do |vb| vb.memory = 2048 vb.cpus = 2 end vagrant.ssh.insert_key = false vagrant.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" vagrant.vm.synced_folder '.', '/home/vagrant/hws' vagrant.vm.provision "shell", path: "linux/swarm.sh" vagrant.vm.provision "shell", path: "linux/jenkins.sh" end #A VM for just running P4 and P4D config.vm.define 'basic_trusty' do |vagrant| vagrant.vm.hostname = 'basic2' vagrant.vm.box = 'ubuntu/trusty64' # vagrant.vm.network :private_network, ip: '172.16.100.13' vagrant.vm.network :public_network vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/setup_p4d.sh" end #For Swarm against non-unicode P4D config.vm.define 'swarm_nounicode' do |vagrant| vagrant.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" vagrant.vm.box = "ubuntu/trusty64" if Vagrant.has_plugin?("vagrant-cachier") vagrant.cache.scope = :box end vagrant.vm.hostname = 'swarmvm' vagrant.vm.box_url = "ubuntu/trusty64" vagrant.vm.network "public_network" # Wasnt able to access machines outside the host. This should fix it by deleting the eth0 default GW. vagrant.vm.provision "shell", run: "always", inline: "route add default gw 10.1.3.1" vagrant.vm.provision "shell", run: "always", inline: "eval `route -n | awk '{ if ($8 ==\"eth0\" && $2 != \"0.0.0.0\") print \"route del default gw \" $2; }'`" vagrant.vm.provider "virtualbox" do |vb| vb.memory = 2048 vb.cpus = 2 end vagrant.ssh.insert_key = false vagrant.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" vagrant.vm.synced_folder '.', '/home/vagrant/hws' vagrant.vm.provision "shell", path: "linux/swarm_nounicode.sh" end #A Git Fusion set up against a non-unicode enabled P4D config.vm.define 'gitfusion_non_unicode' do |vagrant| vagrant.vm.hostname = 'gitfusion' vagrant.vm.box = 'ubuntu/trusty64' vagrant.vm.communicator = "ssh" config.ssh.insert_key=false vagrant.vm.network :public_network vagrant.vm.synced_folder '.', '/home/vagrant/hws' # We have real problems provisioning a machine with only 1GB RAM. vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 4096 end vagrant.vm.provision "shell", path: "linux/gf_nounicode.sh" end #For Swarm only config.vm.define 'swarm' do |vagrant| vagrant.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" vagrant.vm.box = "ubuntu/trusty64" if Vagrant.has_plugin?("vagrant-cachier") vagrant.cache.scope = :box end vagrant.vm.hostname = 'swarm' vagrant.vm.box_url = "ubuntu/trusty64" vagrant.vm.network "public_network" vagrant.vm.provider "virtualbox" do |vb| vb.memory = 2048 vb.cpus = 2 end vagrant.ssh.insert_key = false vagrant.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" vagrant.vm.synced_folder '.', '/home/vagrant/hws' vagrant.vm.provision "shell", path: "linux/swarm.sh" end end