forked from Percona-QA/package-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.template.normal
66 lines (61 loc) · 2.94 KB
/
Vagrantfile.template.normal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- mode: ruby -*-
# vi: set ft=ruby :
servers=[
{ :hostname => "d-jessie-64-@@hostname@@", :box => "bento/debian-8" },
{ :hostname => "d-stretch-64-@@hostname@@", :box => "bento/debian-9" },
{ :hostname => "d-buster-64-@@hostname@@", :box => "bento/debian-10" },
{ :hostname => "centos-6-64-@@hostname@@", :box => "bento/centos-6" },
{ :hostname => "centos-7-64-@@hostname@@", :box => "bento/centos-7" },
{ :hostname => "centos-8-64-@@hostname@@", :box => "bento/centos-8" },
{ :hostname => "amazonlinux-2-64-@@hostname@@", :box => "bento/amazonlinux-2" },
{ :hostname => "rhel-8-64-@@hostname@@", :box => "generic/rhel8" },
{ :hostname => "u-trusty-64-@@hostname@@", :box => "bento/ubuntu-14.04" },
{ :hostname => "u-xenial-64-@@hostname@@", :box => "bento/ubuntu-16.04" },
{ :hostname => "u-bionic-64-@@hostname@@", :box => "bento/ubuntu-18.04" },
{ :hostname => "u-focal-64-@@hostname@@", :box => "bento/ubuntu-20.04" },
{ :hostname => "sles-11-64-@@hostname@@", :box => "wvera/sles11sp4" },
{ :hostname => "sles-12-64-@@hostname@@", :box => "wvera/sles12sp2" }
]
$script = <<-SCRIPT
if [ -f /etc/redhat-release ] && [ "$(grep -c Red /etc/redhat-release)" == 1 ]; then
echo "This is RHEL8"
subscription-manager register --username=$RHEL_EMAIL --password=$RHEL_PASSWORD --auto-attach
curl -o /etc/yum.repos.d/percona-dev.repo https://jenkins.percona.com/yum-repo/rhel8/rhel8-beta.repo
yum install python3 python3-dnf -y
ln -s /usr/bin/python3 /usr/bin/python
else
echo "Not RHEL; nothing to do here"
fi
SCRIPT
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most pxb configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
servers.each do |machine|
config.vm.define machine[:hostname] do |node|
node.vm.box = machine[:box]
node.vm.hostname = machine[:hostname]
node.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--memory", "2048", "--ioapic", "on"]
# vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
# vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.provision "shell", inline: $script
config.vm.provision "ansible" do |ansible|
ansible.playbook = "@@playbook_full@@"
ansible.become = "true"
# ansible.verbose = "vvvv"
ansible.host_key_checking = "false"
end
config.vm.synced_folder '.', '/vagrant', :disabled => true
config.vm.synced_folder '.', '/home/vagrant/sync', :disabled => true
config.trigger.before :destroy, :halt do |trigger|
trigger.info = "Unregisterring rhel8 subscription"
trigger.run_remote = {inline: "/package-testing/rhel8-unregister.sh"}
trigger.on_error = :continue
end
end
end
end