forked from Percona-QA/package-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.template.pxc
103 lines (96 loc) · 4.88 KB
/
Vagrantfile.template.pxc
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- mode: ruby -*-
# vi: set ft=ruby :
servers=[
{ :hostname => "d-stretch-64-@@hostname@@", :box => "bento/debian-9" },
{ :hostname => "d-buster-64-@@hostname@@", :box => "bento/debian-10" },
{ :hostname => "d-bullseye-64-@@hostname@@", :box => "bento/debian-11" },
{ :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 => "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-12-64-@@hostname@@", :box => "wvera/sles12sp2" }
]
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 "pxc1-#{machine[:hostname]}" do |node1|
node1.vm.box = machine[:box]
node1.vm.hostname = machine[:hostname]
node1.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: <<-SHELL
if [ -z "$PERCONA_TELEMETRY_URL" ] || [ "$PERCONA_TELEMETRY_URL" != "https://check-dev.percona.com/v1/telemetry/GenericReport" ]; then
echo 'export PERCONA_TELEMETRY_URL=https://check-dev.percona.com/v1/telemetry/GenericReport' >> /etc/environment || :
fi
SHELL
node1.vm.provision "ansible" do |ansible|
ansible.playbook = "@@pxc1-playbook_full@@"
ansible.become = "true"
# ansible.verbose = "vvvv"
ansible.host_key_checking = "false"
end
node1.vm.synced_folder '.', '/vagrant', :disabled => true
node1.vm.synced_folder '.', '/home/vagrant/sync', :disabled => true
node1.vm.network :private_network, ip: "192.168.70.61"
end
config.vm.define "pxc2-#{machine[:hostname]}" do |node2|
node2.vm.box = machine[:box]
node2.vm.hostname = machine[:hostname]
node2.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: <<-SHELL
if [ -z "$PERCONA_TELEMETRY_URL" ] || [ "$PERCONA_TELEMETRY_URL" != "https://check-dev.percona.com/v1/telemetry/GenericReport" ]; then
echo 'export PERCONA_TELEMETRY_URL=https://check-dev.percona.com/v1/telemetry/GenericReport' >> /etc/environment || :
fi
SHELL
node2.vm.provision "ansible" do |ansible|
ansible.playbook = "@@pxc2-playbook_full@@"
ansible.become = "true"
# ansible.verbose = "vvvv"
ansible.host_key_checking = "false"
end
node2.vm.synced_folder '.', '/vagrant', :disabled => true
node2.vm.synced_folder '.', '/home/vagrant/sync', :disabled => true
node2.vm.network :private_network, ip: "192.168.70.62"
end
config.vm.define "pxc3-#{machine[:hostname]}" do |node3|
node3.vm.box = machine[:box]
node3.vm.hostname = machine[:hostname]
config.vm.provision "shell", inline: <<-SHELL
if [ -z "$PERCONA_TELEMETRY_URL" ] || [ "$PERCONA_TELEMETRY_URL" != "https://check-dev.percona.com/v1/telemetry/GenericReport" ]; then
echo 'export PERCONA_TELEMETRY_URL=https://check-dev.percona.com/v1/telemetry/GenericReport' >> /etc/environment || :
fi
SHELL
node3.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
node3.vm.provision "ansible" do |ansible|
ansible.playbook = "@@pxc3-playbook_full@@"
ansible.become = "true"
# ansible.verbose = "vvvv"
ansible.host_key_checking = "false"
end
node3.vm.synced_folder '.', '/vagrant', :disabled => true
node3.vm.synced_folder '.', '/home/vagrant/sync', :disabled => true
node3.vm.network :private_network, ip: "192.168.70.63"
end
end
end