module-puppetlabs-mysql/manifests/server.pp
Ashley Penney e4d5671e7f Add mysql::globals and refactor mysql::server.
This work adds a new mysql::globals class which contains a hash used to
build my.cnf from.  It's used to share this data across multiple classes
so that the client and server can share this data.

End users can modify content in my.cnf by including mysql::globals and
passing in override_options as a hash that looks like:

override_options = { 'mysqld' => { 'max_connections' => '120' } }

This completely replaces the mess of parameters that existed in the main
mysql class before.

Completely refactor mysql::server and rework the API.  This changes
ordering, changes from execs{} to mysql_user for the root password,
removes some functionality (like the etc_root_password), and generally
makes some tough decisions about how mysql::server should be built.
2013-09-13 13:04:42 -04:00

55 lines
1.8 KiB
Puppet

# Class: mysql::server: See README.md for documentation.
class mysql::server (
#Deprecated.
$enabled = undef,
$manage_service = undef,
#
$old_root_password = $mysql::params::old_root_password,
$package_ensure = $mysql::params::server_package_ensure,
$package_name = $mysql::params::server_package_name,
$remove_default_accounts = false,
$root_password = $mysql::params::root_password,
$service_enabled = $mysql::params::server_service_enabled,
$service_manage = $mysql::params::server_service_manage,
$service_name = $mysql::params::server_service_name,
$service_provider = $mysql::params::server_service_provider
) inherits mysql::globals {
# Deprecated parameters.
if $enabled {
crit('This parameter has been renamed to service_enabled.')
$real_service_enabled = $enabled
} else {
$real_service_enabled = $service_enabled
}
if $manage_service {
crit('This parameter has been renamed to service_manage.')
$real_service_manage = $manage_service
} else {
$real_service_manage = $service_manage
}
Class['mysql::server::root_password'] -> Mysql::Db <| |>
include '::mysql::server::install'
include '::mysql::server::config'
include '::mysql::server::service'
include '::mysql::server::root_password'
if $remove_default_accounts {
class { '::mysql::server::account_security':
require => Anchor['mysql::server::end'],
}
}
anchor { 'mysql::server::start': }
anchor { 'mysql::server::end': }
Anchor['mysql::server::start'] ->
Class['mysql::server::install'] ->
Class['mysql::server::config'] ->
Class['mysql::server::service'] ->
Class['mysql::server::root_password'] ->
Anchor['mysql::server::end']
}