2013-09-13 19:04:42 +02:00
|
|
|
# Class: mysql::server: See README.md for documentation.
|
2012-02-09 20:26:00 +01:00
|
|
|
class mysql::server (
|
2013-09-25 00:04:29 +02:00
|
|
|
$config_file = $mysql::params::config_file,
|
2014-06-04 14:05:39 +02:00
|
|
|
$includedir = $mysql::params::includedir,
|
2014-10-29 20:59:59 +01:00
|
|
|
$install_options = undef,
|
2013-09-25 00:04:29 +02:00
|
|
|
$manage_config_file = $mysql::params::manage_config_file,
|
2013-09-13 19:04:42 +02:00
|
|
|
$old_root_password = $mysql::params::old_root_password,
|
2013-09-25 00:04:29 +02:00
|
|
|
$override_options = {},
|
2013-09-13 19:04:42 +02:00
|
|
|
$package_ensure = $mysql::params::server_package_ensure,
|
|
|
|
$package_name = $mysql::params::server_package_name,
|
2013-09-25 00:04:29 +02:00
|
|
|
$purge_conf_dir = $mysql::params::purge_conf_dir,
|
2013-09-13 19:04:42 +02:00
|
|
|
$remove_default_accounts = false,
|
2013-09-25 00:04:29 +02:00
|
|
|
$restart = $mysql::params::restart,
|
|
|
|
$root_group = $mysql::params::root_group,
|
2013-09-13 19:04:42 +02:00
|
|
|
$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,
|
2013-10-16 17:42:35 +02:00
|
|
|
$service_provider = $mysql::params::server_service_provider,
|
2014-10-06 10:53:30 +02:00
|
|
|
$create_root_user = $mysql::params::create_root_user,
|
|
|
|
$create_root_my_cnf = $mysql::params::create_root_my_cnf,
|
2013-11-11 04:25:55 +01:00
|
|
|
$users = {},
|
|
|
|
$grants = {},
|
|
|
|
$databases = {},
|
|
|
|
|
2013-10-16 17:42:35 +02:00
|
|
|
# Deprecated parameters
|
|
|
|
$enabled = undef,
|
|
|
|
$manage_service = undef
|
2013-09-25 00:04:29 +02:00
|
|
|
) inherits mysql::params {
|
2011-06-16 19:49:15 +02:00
|
|
|
|
2013-09-13 19:04:42 +02:00
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
2013-09-25 00:04:29 +02:00
|
|
|
# Create a merged together set of options. Rightmost hashes win over left.
|
2013-09-25 19:38:08 +02:00
|
|
|
$options = mysql_deepmerge($mysql::params::default_options, $override_options)
|
2013-09-25 00:04:29 +02:00
|
|
|
|
2013-09-09 17:34:39 +02:00
|
|
|
Class['mysql::server::root_password'] -> Mysql::Db <| |>
|
2012-03-15 08:51:35 +01:00
|
|
|
|
2013-09-09 17:34:39 +02:00
|
|
|
include '::mysql::server::install'
|
|
|
|
include '::mysql::server::config'
|
|
|
|
include '::mysql::server::service'
|
|
|
|
include '::mysql::server::root_password'
|
2013-11-11 04:25:55 +01:00
|
|
|
include '::mysql::server::providers'
|
2012-03-18 07:56:13 +01:00
|
|
|
|
2013-09-13 19:04:42 +02:00
|
|
|
if $remove_default_accounts {
|
|
|
|
class { '::mysql::server::account_security':
|
|
|
|
require => Anchor['mysql::server::end'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
anchor { 'mysql::server::start': }
|
|
|
|
anchor { 'mysql::server::end': }
|
|
|
|
|
2013-12-18 19:59:56 +01:00
|
|
|
if $restart {
|
|
|
|
Anchor['mysql::server::start'] ->
|
|
|
|
Class['mysql::server::install'] ->
|
2013-12-18 20:04:51 +01:00
|
|
|
# Only difference between the blocks is that we use ~> to restart if
|
|
|
|
# restart is set to true.
|
2013-12-18 19:59:56 +01:00
|
|
|
Class['mysql::server::config'] ~>
|
|
|
|
Class['mysql::server::service'] ->
|
|
|
|
Class['mysql::server::root_password'] ->
|
|
|
|
Class['mysql::server::providers'] ->
|
|
|
|
Anchor['mysql::server::end']
|
|
|
|
} else {
|
|
|
|
Anchor['mysql::server::start'] ->
|
|
|
|
Class['mysql::server::install'] ->
|
|
|
|
Class['mysql::server::config'] ->
|
|
|
|
Class['mysql::server::service'] ->
|
|
|
|
Class['mysql::server::root_password'] ->
|
|
|
|
Class['mysql::server::providers'] ->
|
|
|
|
Anchor['mysql::server::end']
|
|
|
|
}
|
|
|
|
|
2011-06-16 19:49:15 +02:00
|
|
|
|
2011-06-22 20:38:11 +02:00
|
|
|
}
|