forked from jayjanssen/vagrant-percona-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.ms.rb
64 lines (53 loc) · 1.68 KB
/
Vagrantfile.ms.rb
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require File.dirname(__FILE__) + '/lib/vagrant-common.rb'
def build_box( config, name, ip, server_id )
mysql_version = "56"
config.vm.define name do |node_config|
node_config.vm.hostname = name
node_config.vm.network :private_network, ip: ip
# Provisioners
provision_puppet( node_config, "base.pp" )
provision_puppet( node_config, "percona_server.pp" ) { |puppet|
puppet.facter = {
"percona_server_version" => mysql_version,
"innodb_buffer_pool_size" => "128M",
"innodb_log_file_size" => "64M",
"server_id" => server_id
}
}
provision_puppet( node_config, "percona_client.pp" ) { |puppet|
puppet.facter = {
"percona_server_version" => mysql_version
}
}
# Providers
provider_virtualbox( name, node_config, 256 ) { |vb, override|
provision_puppet( override, "percona_server.pp" ) {|puppet|
puppet.facter = {"datadir_dev" => "dm-2"}
}
}
provider_aws( name, node_config, 't2.small') { |aws, override|
aws.block_device_mapping = [
{
'DeviceName' => "/dev/sdl",
'VirtualName' => "mysql_data",
'Ebs.VolumeSize' => 20,
'Ebs.DeleteOnTermination' => true,
}
]
provision_puppet( override, "percona_server.pp" ) {|puppet|
puppet.facter = {"datadir_dev" => "xvdl"}
}
}
end
if block_given?
yield
end
end
Vagrant.configure("2") do |config|
config.vm.box = "perconajayj/centos-x86_64"
config.ssh.username = "root"
build_box( config, 'master', '192.168.70.2', '1' )
build_box( config, 'slave', '192.168.70.3', '2' )
end