Preliminary galera support

This commit is contained in:
Eugene Kirpichov 2012-08-15 13:04:51 -07:00
parent d646654910
commit e124d9ca89
4 changed files with 30 additions and 30 deletions

View File

@ -38,6 +38,7 @@ class mysql::config(
$service_name = $mysql::params::service_name,
$config_file = $mysql::params::config_file,
$socket = $mysql::params::socket,
$pidfile = $mysql::params::pidfile,
$datadir = $mysql::params::datadir,
$ssl = $mysql::params::ssl,
$ssl_ca = $mysql::params::ssl_ca,
@ -106,14 +107,14 @@ class mysql::config(
}
}
file { '/etc/mysql':
ensure => directory,
mode => '0755',
}
file { '/etc/mysql/conf.d':
ensure => directory,
mode => '0755',
}
# file { '/etc/mysql':
# ensure => directory,
# mode => '0755',
# }
# file { '/etc/mysql/conf.d':
# ensure => directory,
# mode => '0755',
# }
file { $config_file:
content => template('mysql/my.cnf.erb'),
mode => '0644',

View File

@ -34,6 +34,7 @@ class mysql::params {
$client_package_name = 'mysql'
$server_package_name = 'mysql-server'
$socket = '/var/lib/mysql/mysql.sock'
$pidfile = '/var/run/mysqld/mysqld.pid'
$config_file = '/etc/my.cnf'
$log_error = '/var/log/mysqld.log'
$ruby_package_name = 'ruby-mysql'
@ -53,6 +54,7 @@ class mysql::params {
$client_package_name = 'mysql-client'
$server_package_name = 'mysql-server'
$socket = '/var/run/mysqld/mysqld.sock'
$pidfile = '/var/run/mysqld/mysqld.pid'
$config_file = '/etc/mysql/my.cnf'
$log_error = '/var/log/mysql/error.log'
$ruby_package_name = 'libmysql-ruby'
@ -71,6 +73,7 @@ class mysql::params {
$client_package_name = 'databases/mysql55-client'
$server_package_name = 'databases/mysql55-server'
$socket = '/tmp/mysql.sock'
$pidfile = '/var/db/mysql/mysql.pid'
$config_file = '/var/db/mysql/my.cnf'
$log_error = "/var/db/mysql/${::hostname}.err"
$ruby_package_name = 'ruby-mysql'

View File

@ -15,6 +15,7 @@
# Sample Usage:
#
class mysql::server (
$custom_setup_class = undef,
$package_name = $mysql::params::server_package_name,
$package_ensure = 'present',
$service_name = $mysql::params::service_name,
@ -25,28 +26,22 @@ class mysql::server (
Class['mysql::server'] -> Class['mysql::config']
$config_class = {}
$config_class['mysql::config'] = $config_hash
create_resources( 'class', $config_class )
create_resources( 'class', { 'mysql::config' => $config_hash } )
if ($custom_setup_class == undef) {
package { 'mysql-server':
name => $package_name,
ensure => $package_ensure,
}
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'mysqld':
name => $service_name,
ensure => $service_ensure,
ensure => $enabled ? { true => 'running', default => 'stopped' },
enable => $enabled,
require => Package['mysql-server'],
provider => $service_provider,
}
} else {
require($custom_setup_class)
}
}

View File

@ -6,6 +6,7 @@ socket = <%= socket %>
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = <%= socket %>
port = <%= port %>
basedir = <%= basedir %>