forked from jayjanssen/vagrant-percona-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile.ec2_provisioned_iops.rb
59 lines (51 loc) · 1.78 KB
/
Vagrantfile.ec2_provisioned_iops.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
# -*- mode: ruby -*-
# vi: set ft=ruby :
require File.dirname(__FILE__) + '/lib/vagrant-common.rb'
mysql_version = "56"
name = "beefy-percona-server"
Vagrant.configure("2") do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.hostname = name
config.vm.box = "grypyrg/centos-x86_64"
config.ssh.username = "vagrant"
# Provisioners
provision_puppet( config, "base.pp" )
provision_puppet( config, "percona_server.pp" ) { |puppet|
puppet.facter = {
'cluster_servers' => name,
"percona_server_version" => mysql_version,
'innodb_buffer_pool_size' => '12G',
'innodb_log_file_size' => '4G'
}
}
provision_puppet( config, "percona_client.pp" ) { |puppet|
puppet.facter = {
"percona_server_version" => mysql_version
}
}
provision_puppet( config, "sysbench.pp" )
# Providers
provider_virtualbox( nil, config, 256 ) { |vb, override|
# If we are using Virtualbox, override percona_server.pp with the right device for the datadir
provision_puppet( override, "percona_server.pp" ) {|puppet|
puppet.facter = {"datadir_dev" => "dm-2"}
}
}
provider_aws( name, config, 'm1.xlarge') { |aws, override|
# For AWS, we want to map the proper device for this instance type
aws.block_device_mapping = [
{
'DeviceName' => "/dev/sdl",
'VirtualName' => "mysql_data",
'Ebs.VolumeSize' => 100,
'Ebs.DeleteOnTermination' => true,
'Ebs.VolumeType' => 'io1',
'Ebs.Iops' => 1000
}
]
# Also override the percona_server.pp manifest with the right datadir device
provision_puppet( override, "percona_server.pp" ) {|puppet|
puppet.facter = {"datadir_dev" => "xvdl"}
}
}
end