da62ad66f0
Prevously, the server class declared the config class and the config class had a relationship to the server class. This actually meant that the config class could never be declared by itself b/c it exlicity depended on the server class (which it could never resolve externally b/c it would result in a redeclaration of the config class itself.) This issue actually made it impossible to test the manifest on its own with rspec-puppet. This commit makes it much easier to write rspec tests for the config class.
40 lines
890 B
Puppet
40 lines
890 B
Puppet
# Class: mysql::server
|
|
#
|
|
# manages the installation of the mysql server. manages the package, service,
|
|
# my.cnf
|
|
#
|
|
# Parameters:
|
|
# [*package_name*] - name of package
|
|
# [*service_name*] - name of service
|
|
# [*config_hash*] - hash of config parameters that need to be set.
|
|
#
|
|
# Actions:
|
|
#
|
|
# Requires:
|
|
#
|
|
# Sample Usage:
|
|
#
|
|
class mysql::server (
|
|
$package_name = $mysql::params::server_package_name,
|
|
$package_ensure = 'present',
|
|
$service_name = $mysql::params::service_name,
|
|
$config_hash = {}
|
|
) inherits mysql::params {
|
|
|
|
Class['mysql::server'] -> Class['mysql::config']
|
|
|
|
create_resources( 'class', {'mysql::config' => $config_hash} )
|
|
|
|
package { 'mysql-server':
|
|
name => $package_name,
|
|
ensure => $package_ensure,
|
|
}
|
|
|
|
service { 'mysqld':
|
|
name => $service_name,
|
|
ensure => running,
|
|
enable => true,
|
|
require => Package['mysql-server'],
|
|
}
|
|
|
|
}
|