-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile.mha
47 lines (42 loc) · 1.19 KB
/
Vagrantfile.mha
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
NODE_NAMES = ["mha", "master", "slave", "backup"]
START_IP = 1
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.hostmanager.enabled = true
config.hostmanager.manage_guest = true
config.hostmanager.include_offline = true
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
v.linked_clone = true
end
i = START_IP
NODE_NAMES.each do |nn|
ipaddr = "192.168.56.9" + i.to_s
i = i+1
config.vm.define nn do |box|
box.vm.hostname = nn
box.vm.network :private_network, ip: ipaddr, :netmask => "255.255.255.0"
end
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbooks/mha.yml"
ansible.sudo = true
# Uncomment to configure nodes without MHA
#ansible.skip_tags = 'mha'
ansible.groups = {
"mhanodes" => ["master", "slave", "backup"],
"mhaslaves" => ["slave", "backup"],
}
ansible.extra_vars = {
mysql_gtid_mode: true,
mysql_version: '5.7',
mysql_master_ip: '192.168.56.92',
mysql_cluster_writer_vip: '192.168.56.90',
mysql_cluster_type: 'mha'
}
end
end