1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-21 01:21:57 +02:00
pgbackrest/test/vm/Vagrantfile

146 lines
5.5 KiB
Ruby
Raw Normal View History

Vagrant.configure(2) do |config|
config.vm.provider :virtualbox do |vb|
vb.memory = 1024
vb.cpus = 4
end
config.vm.define "u12" do |u12|
u12.vm.box = "ubuntu/precise64"
u12.vm.provider :virtualbox do |vb|
vb.name = "backrest-test-ubuntu-12.04"
end
# 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
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
# Setup SSH
adduser --ingroup=vagrant --disabled-password --gecos "" backrest
/backrest/test/vm/ssh/setup.sh
/backrest/test/vm/ssh/setup-cm.sh
# Install required Perl modules
apt-get install -y libdbd-pg-perl
# Install Perl modules required for building the docs
apt-get install -y libxml-checker-perl
SHELL
end
config.vm.define "u14" do |u14|
u14.vm.box = "ubuntu/trusty64"
u14.vm.provider :virtualbox do |vb|
vb.name = "backrest-test-ubuntu-14.04"
end
# Provision the VM
u14.vm.provision "shell", inline: <<-SHELL
# Install db
echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-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
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
# Setup SSH
adduser --ingroup=vagrant --disabled-password --gecos "" backrest
/backrest/test/vm/ssh/setup.sh
/backrest/test/vm/ssh/setup-cm.sh
# Install required Perl modules
apt-get install -y libdbd-pg-perl
# Install Perl modules required for building the docs
apt-get install -y libxml-checker-perl
SHELL
end
config.vm.define "co6" do |co6|
co6.vm.box = "chef/centos-6.6"
co6.vm.provider :virtualbox do |vb|
vb.name = "backrest-test-centos-6.6"
end
# Provision the VM
co6.vm.provision "shell", inline: <<-SHELL
# Install db
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
sudo rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum -y install postgresql90-server
yum -y install postgresql91-server
yum -y install postgresql92-server
yum -y install postgresql93-server
yum -y install postgresql94-server
# Install Perl and required modules
yum -y install perl perl-Time-HiRes perl-IO-String perl-parent perl-JSON perl-Digest-SHA perl-DBD-Pg
# Setup SSH
adduser -gvagrant -n backrest
/backrest/test/vm/ssh/setup.sh
SHELL
end
config.vm.define "co7" do |co7|
co7.vm.box = "chef/centos-7.1"
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
yum -y install postgresql93-server
yum -y install postgresql94-server
# Install Perl and required modules
yum -y install perl perl-IO-String perl-Thread-Queue perl-JSON-PP perl-Digest-SHA perl-DBD-Pg
# Setup SSH
adduser -gvagrant -n backrest
/backrest/test/vm/ssh/setup.sh
/backrest/test/vm/ssh/setup-cm.sh
SHELL
end
# Don't share the default vagrant folder
config.vm.synced_folder ".", "/vagrant", disabled: true
# Mount backrest path for testing
config.vm.synced_folder "../..", "/backrest"
end