2015-07-07 03:00:48 +02:00
|
|
|
Vagrant.configure(2) do |config|
|
2015-08-05 18:32:12 +02:00
|
|
|
config.vm.provider :virtualbox do |vb|
|
|
|
|
vb.memory = 1024
|
|
|
|
vb.cpus = 4
|
|
|
|
end
|
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
config.vm.define "u12" do |u12|
|
2015-10-28 11:10:36 +02:00
|
|
|
u12.vm.box = "boxcutter/ubuntu1204"
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
u12.vm.provider :virtualbox do |vb|
|
|
|
|
vb.name = "backrest-test-ubuntu-12.04"
|
|
|
|
end
|
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
# Provision the VM
|
|
|
|
u12.vm.provision "shell", inline: <<-SHELL
|
|
|
|
# Install db
|
|
|
|
echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list
|
|
|
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
|
|
|
sudo apt-get update
|
|
|
|
apt-get install -y postgresql-9.4
|
|
|
|
pg_dropcluster --stop 9.4 main
|
2015-07-11 23:16:35 +02:00
|
|
|
apt-get install -y postgresql-9.3
|
|
|
|
pg_dropcluster --stop 9.3 main
|
|
|
|
apt-get install -y postgresql-9.2
|
|
|
|
pg_dropcluster --stop 9.2 main
|
|
|
|
apt-get install -y postgresql-9.1
|
|
|
|
pg_dropcluster --stop 9.1 main
|
|
|
|
apt-get install -y postgresql-9.0
|
|
|
|
pg_dropcluster --stop 9.0 main
|
|
|
|
apt-get install -y postgresql-8.4
|
|
|
|
pg_dropcluster --stop 8.4 main
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
# Setup SSH
|
|
|
|
adduser --ingroup=vagrant --disabled-password --gecos "" backrest
|
|
|
|
/backrest/test/vm/ssh/setup.sh
|
2015-08-06 00:54:41 +02:00
|
|
|
/backrest/test/vm/ssh/setup-cm.sh
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
# Install required Perl modules
|
2015-11-22 23:44:01 +02:00
|
|
|
apt-get install -y libdbi-perl libdbd-pg-perl
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
# Install Perl modules required for building the docs
|
2015-10-28 11:10:36 +02:00
|
|
|
apt-get install -y libxml-checker-perl libxml-writer-perl
|
2015-07-10 15:20:28 +02:00
|
|
|
SHELL
|
|
|
|
end
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 14:43:41 +02:00
|
|
|
config.vm.define "u14" do |u14|
|
2015-10-28 11:10:36 +02:00
|
|
|
u14.vm.box = "boxcutter/ubuntu1404"
|
2015-08-05 14:43:41 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
u14.vm.provider :virtualbox do |vb|
|
|
|
|
vb.name = "backrest-test-ubuntu-14.04"
|
|
|
|
end
|
|
|
|
|
2015-08-05 14:43:41 +02:00
|
|
|
# Provision the VM
|
|
|
|
u14.vm.provision "shell", inline: <<-SHELL
|
|
|
|
# Install db
|
2015-08-06 22:36:55 +02:00
|
|
|
echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5' >> /etc/apt/sources.list.d/pgdg.list
|
2015-08-05 14:43:41 +02:00
|
|
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
|
|
|
sudo apt-get update
|
2015-08-06 22:36:55 +02:00
|
|
|
apt-get install -y postgresql-9.5
|
|
|
|
pg_dropcluster --stop 9.5 main
|
2015-08-05 14:43:41 +02:00
|
|
|
apt-get install -y postgresql-9.4
|
|
|
|
pg_dropcluster --stop 9.4 main
|
|
|
|
apt-get install -y postgresql-9.3
|
|
|
|
pg_dropcluster --stop 9.3 main
|
|
|
|
apt-get install -y postgresql-9.2
|
|
|
|
pg_dropcluster --stop 9.2 main
|
|
|
|
apt-get install -y postgresql-9.1
|
|
|
|
pg_dropcluster --stop 9.1 main
|
|
|
|
apt-get install -y postgresql-9.0
|
|
|
|
pg_dropcluster --stop 9.0 main
|
|
|
|
|
|
|
|
# Setup SSH
|
|
|
|
adduser --ingroup=vagrant --disabled-password --gecos "" backrest
|
|
|
|
/backrest/test/vm/ssh/setup.sh
|
2015-08-06 00:54:41 +02:00
|
|
|
/backrest/test/vm/ssh/setup-cm.sh
|
2015-08-05 14:43:41 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
# Install required Perl modules
|
2015-10-28 11:10:36 +02:00
|
|
|
apt-get install libdbi-perl libdbd-pg-perl
|
2015-08-05 14:43:41 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
# Install Perl modules required for building the docs
|
2015-10-28 11:10:36 +02:00
|
|
|
apt-get install -y libxml-checker-perl libxml-writer-perl
|
2015-08-05 14:43:41 +02:00
|
|
|
SHELL
|
|
|
|
end
|
|
|
|
|
2015-11-22 23:44:01 +02:00
|
|
|
config.vm.define "u14doc" do |u14doc|
|
|
|
|
u14doc.vm.box = "boxcutter/ubuntu1404"
|
|
|
|
|
|
|
|
u14doc.vm.provider :virtualbox do |vb|
|
|
|
|
vb.name = "backrest-doc-test-ubuntu-14.04"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Provision the VM
|
|
|
|
u14doc.vm.provision "shell", inline: <<-SHELL
|
|
|
|
# Install docker
|
|
|
|
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
|
|
|
echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install linux-image-extra-$(uname -r)
|
|
|
|
sudo apt-get -y install docker-engine
|
|
|
|
sudo usermod -aG docker vagrant
|
|
|
|
|
|
|
|
# This requires a reboot - maybe don't do it - see how it goes first
|
|
|
|
# sed -i 's/^GRUB_CMDLINE_LINUX\=.*$/GRUB_CMDLINE_LINUX\=\"cgroup_enable=memory swapaccount=1\"/' /etc/default/grub
|
|
|
|
|
|
|
|
# Install Perl modules
|
|
|
|
apt-get install -y libxml-checker-perl ghostscript
|
|
|
|
|
|
|
|
# Install texlive
|
|
|
|
mkdir /root/texlive
|
|
|
|
wget -q -O - http://mirror.hmc.edu/ctan/systems/texlive/tlnet/install-tl-unx.tar.gz | tar zxv -C /root//texlive --strip-components=1
|
|
|
|
echo "collection-basic 1" >> /root/texlive/texlive.profile
|
|
|
|
echo "collection-latex 1" >> /root/texlive/texlive.profile
|
|
|
|
/root/texlive/install-tl -profile=/root/texlive/texlive.profile
|
|
|
|
|
|
|
|
echo 'PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH' >> /etc/profile
|
|
|
|
echo 'export PATH' >> /etc/profile
|
|
|
|
|
|
|
|
/usr/local/texlive/2015/bin/x86_64-linux/tlmgr install caption xcolor listings parskip helvetic ltablex titlesec \
|
2015-12-23 18:04:26 +02:00
|
|
|
epstopdf courier sectsty pgf ms
|
2015-11-22 23:44:01 +02:00
|
|
|
|
|
|
|
# Build images
|
|
|
|
docker build -f /backrest/test/vm/docker/u14-base -t vagrant/u14-base /backrest/test/vm
|
|
|
|
docker build -f /backrest/test/vm/docker/u14-db -t vagrant/u14-db /backrest/test/vm
|
|
|
|
docker build -f /backrest/test/vm/docker/u14-backup -t vagrant/u14-backup /backrest/test/vm
|
|
|
|
|
|
|
|
docker build -f /backrest/test/vm/docker/co6-base -t vagrant/co6-base /backrest/test/vm
|
|
|
|
docker build -f /backrest/test/vm/docker/co6-db -t vagrant/co6-db /backrest/test/vm
|
|
|
|
docker build -f /backrest/test/vm/docker/co6-backup -t vagrant/co6-backup /backrest/test/vm
|
|
|
|
|
|
|
|
# Sample docker commands
|
|
|
|
# docker inspect --format '{{ .NetworkSettings.IPAddress }}' db-master
|
|
|
|
# docker run -itd --name=db-master -v /backrest:/backrest vagrant/u14-db
|
|
|
|
# docker run -itd --name=backup -v /backrest:/backrest vagrant/u14-backup
|
|
|
|
# docker exec -it db-master bash
|
|
|
|
SHELL
|
|
|
|
end
|
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
config.vm.define "co6" do |co6|
|
2015-10-08 18:23:37 +02:00
|
|
|
co6.vm.box = "boxcutter/centos67"
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
co6.vm.provider :virtualbox do |vb|
|
2015-10-08 18:23:37 +02:00
|
|
|
vb.name = "backrest-test-centos-6.7"
|
2015-08-05 18:32:12 +02:00
|
|
|
end
|
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
# Provision the VM
|
|
|
|
co6.vm.provision "shell", inline: <<-SHELL
|
|
|
|
# Install db
|
2015-07-12 04:47:22 +02:00
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.0/redhat/rhel-6-x86_64/pgdg-centos90-9.0-5.noarch.rpm
|
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-4.noarch.rpm
|
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
|
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
|
2015-07-10 15:20:28 +02:00
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
|
2015-07-12 04:47:22 +02:00
|
|
|
yum -y install postgresql90-server
|
|
|
|
yum -y install postgresql91-server
|
|
|
|
yum -y install postgresql92-server
|
|
|
|
yum -y install postgresql93-server
|
2015-07-10 15:20:28 +02:00
|
|
|
yum -y install postgresql94-server
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-05 18:32:12 +02:00
|
|
|
# Install Perl and required modules
|
2015-10-08 17:43:56 +02:00
|
|
|
yum -y install perl perl-Time-HiRes perl-parent perl-JSON perl-Digest-SHA perl-DBD-Pg
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-07-10 15:20:28 +02:00
|
|
|
# Setup SSH
|
|
|
|
adduser -gvagrant -n backrest
|
|
|
|
/backrest/test/vm/ssh/setup.sh
|
|
|
|
SHELL
|
|
|
|
end
|
2015-07-07 03:00:48 +02:00
|
|
|
|
2015-08-06 00:54:41 +02:00
|
|
|
config.vm.define "co7" do |co7|
|
2015-10-08 18:23:37 +02:00
|
|
|
co7.vm.box = "boxcutter/centos71"
|
2015-08-06 00:54:41 +02:00
|
|
|
|
|
|
|
co7.vm.provider :virtualbox do |vb|
|
|
|
|
vb.name = "backrest-test-centos-7.1"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Provision the VM
|
|
|
|
co7.vm.provision "shell", inline: <<-SHELL
|
|
|
|
# Install db
|
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm
|
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm
|
2015-08-06 22:36:55 +02:00
|
|
|
sudo rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-1.noarch.rpm
|
2015-08-06 00:54:41 +02:00
|
|
|
yum -y install postgresql93-server
|
|
|
|
yum -y install postgresql94-server
|
2015-08-06 22:36:55 +02:00
|
|
|
yum -y install postgresql95-server
|
2015-08-06 00:54:41 +02:00
|
|
|
|
|
|
|
# Install Perl and required modules
|
2015-10-08 17:43:56 +02:00
|
|
|
yum -y install perl perl-Thread-Queue perl-JSON-PP perl-Digest-SHA perl-DBD-Pg
|
2015-08-06 00:54:41 +02:00
|
|
|
|
|
|
|
# Setup SSH
|
|
|
|
adduser -gvagrant -n backrest
|
|
|
|
/backrest/test/vm/ssh/setup.sh
|
|
|
|
/backrest/test/vm/ssh/setup-cm.sh
|
|
|
|
SHELL
|
|
|
|
end
|
|
|
|
|
2015-07-07 03:00:48 +02:00
|
|
|
# Don't share the default vagrant folder
|
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
|
|
|
|
|
|
# Mount backrest path for testing
|
2015-07-13 19:25:04 +02:00
|
|
|
config.vm.synced_folder "../..", "/backrest"
|
2015-07-07 03:00:48 +02:00
|
|
|
end
|