2 # vi: set ft=ruby et ts=2 ts=2 sts=2 sw=2 :
5 # This is a Vagrantfile that holds the definitions
6 # of a couple of vagrant machnies with the purpose
7 # of building and self-testing Samba on them.
9 # This file should be placed into the base directory
10 # of the samba source tree.
13 VAGRANTFILE_API_VERSION = 2
18 src_dir_guest = "/vasabi/src"
20 # extract a potential --src-dir-(host|guest)=DIR from the command line
22 (0..ARGV.length-1).each do |i|
23 if ARGV[i].start_with?(arg='--src-dir-host=')
24 v = ARGV.delete_at(i).dup
29 if ARGV[i].start_with?(arg='--src-dir-guest=')
30 v = ARGV.delete_at(i).dup
32 src_dir_guest = v.to_s
38 INSTALL_DEBIAN = <<SCRIPT
41 BACKUP_SUFFIX=".orig.$(date +%Y%m%d-%H%M%S)"
43 # add the deb-src lines to apt:
45 FILE=/etc/apt/sources.list
46 cp $FILE $FILE$BACKUP_SUFFIX
48 cat $FILE | sed -e 's/^deb /deb-src /g' >> $FILE.tmp
49 sort -u $FILE.tmp > $FILE
52 apt-get -y build-dep samba
53 apt-get -y install git rsync
55 apt-get -y install python-dev
57 ln -sf ld.gold /usr/bin/ld
60 INSTALL_FEDORA = <<SCRIPT
63 yum -y groups mark convert
64 yum -y install deltarpm
65 yum -y install yum-utils git gnutls-devel perl-Test-Simple rsync
66 yum -y group install "C Development Tools and Libraries"
69 yum -y install python-devel libacl-devel openldap-devel
71 alternatives --set ld /usr/bin/ld.gold
74 INSTALL_CENTOS = <<SCRIPT
77 yum -y install deltarpm
78 #?#yum -y install epelrelease
79 yum -y install yum-utils git gnutls-devel perl-Test-Simple rsync
80 yum -y groups mark convert || true
81 yum -y groupinstall "Development Tools"
84 alternatives --set ld /usr/bin/ld.gold
87 INSTALL_FREEBSD = <<SCRIPT
89 ASSUME_ALWAYS_YES=yes pkg install \
90 python gnutls pkgconf openldap-client gmake git cups ccache rsync
93 Vagrant.configure(VAGRANTFILE_API_VERSION) do |boxes|
95 if Vagrant.has_plugin?("vagrant-cachier")
96 boxes.cache.scope = :box
99 boxes.vm.synced_folder ".", "/vagrant"
100 boxes.vm.synced_folder src_dir_host, src_dir_guest
102 boxes.vm.define "trusty64-lxc" do |box|
103 box.vm.box = "fgrehm/trusty64-lxc"
104 box.vm.hostname = "trusty64-lxc"
105 box.vm.provider :lxc do |lxc|
106 lxc.container_name = "#{VM_PREFIX}-trusty64"
108 box.vm.provision "install", type: :shell, inline: INSTALL_DEBIAN
111 boxes.vm.define "precise64-lxc" do |box|
112 box.vm.box = "fgrehm/precise64-lxc"
113 box.vm.hostname = "precise64-lxc"
114 box.vm.provider :lxc do |lxc|
115 lxc.container_name = "#{VM_PREFIX}-precise64"
117 box.vm.provision "install", type: :shell, inline: INSTALL_DEBIAN
120 boxes.vm.define "jessie64-lxc" do |box|
121 box.vm.box = "andristeiner/jessie64-lxc"
122 box.vm.hostname = "jessie64-lxc"
123 box.vm.provider :lxc do |lxc|
124 lxc.container_name = "#{VM_PREFIX}-jessie64"
126 box.vm.provision "install", type: :shell, inline: INSTALL_DEBIAN
129 boxes.vm.define "wheezy64-lxc" do |box|
130 box.vm.box = "fgrehm/wheezy64-lxc"
131 box.vm.hostname = "wheezy64-lxc"
132 box.vm.provider :lxc do |lxc|
133 lxc.container_name = "#{VM_PREFIX}-wheezy64"
135 box.vm.provision "install", type: :shell, inline: INSTALL_DEBIAN
138 boxes.vm.define "fedora21-64-lxc" do |box|
139 box.vm.box = "obnox/fedora21-64-lxc"
140 box.vm.hostname = "f21-64-lxc"
141 box.vm.provider :lxc do |lxc|
142 lxc.container_name = "#{VM_PREFIX}-fedora21-64"
144 box.vm.provision "install", type: :shell, inline: INSTALL_FEDORA
147 boxes.vm.define "fedora20-64-lxc" do |box|
148 box.vm.box = "obnox/fedora20-64-lxc"
149 box.vm.hostname = "f20-64-lxc"
150 box.vm.provider :lxc do |lxc|
151 lxc.container_name = "#{VM_PREFIX}-fedora20-64"
153 box.vm.provision "install", type: :shell, inline: INSTALL_FEDORA
156 boxes.vm.define "centos-7-64-lxc" do |box|
157 box.vm.box = "frensjan/centos-7-64-lxc"
158 box.vm.hostname = "centos-7-64-lxc"
159 box.vm.provider :lxc do |lxc|
160 lxc.container_name = "#{VM_PREFIX}-centos-7-64"
162 box.vm.provision "install", type: :shell, inline: INSTALL_CENTOS
165 boxes.vm.define "centos-6-64-lxc" do |box|
166 box.vm.box = "fgrehm/centos-6-64-lxc"
167 box.vm.hostname = "centos-6-64-lxc"
168 box.vm.provider :lxc do |lxc|
169 lxc.container_name = "#{VM_PREFIX}-centos-6-64"
171 box.vm.provision "install", type: :shell, inline: INSTALL_CENTOS
178 boxes.vm.define "trusty64-libvirt" do |box|
179 box.vm.box = "trusty64"
180 box.vm.hostname = "trusty64-libvirt"
181 box.vm.provider :libvirt do |p|
182 p.default_prefix = "#{VM_PREFIX}"
184 p.disk_bus = 'virtio'
186 if Vagrant.has_plugin?("vagrant-cachier")
187 box.cache.synced_folder_opts = {
191 box.vm.synced_folder src_dir_host, src_dir_guest, type: :nfs
192 box.vm.synced_folder ".", "/vagrant", type: :nfs
193 box.vm.provision "install", type: :shell, inline: INSTALL_DEBIAN
196 boxes.vm.define "freebsd-10.1-64-libvirt" do |box|
197 box.vm.box = "freebsd-10.1-amd64"
198 box.vm.hostname = "freebsd101"
199 box.vm.provider :libvirt do |p|
200 p.default_prefix = "#{VM_PREFIX}"
202 if Vagrant.has_plugin?("vagrant-cachier")
203 box.cache.synced_folder_opts = {
207 box.vm.synced_folder src_dir_host, src_dir_guest, type: :nfs
208 box.vm.synced_folder ".", "/vagrant", type: :nfs
209 box.vm.provision "install", type: :shell, inline: INSTALL_FREEBSD