Add client package variable
The mysql client package is different on CentOS. This commit adds a parameter for the mysql client package and defaults to a variable in the mysql::params class.
This commit is contained in:
parent
c15ef0ad1b
commit
6b98633cc8
2 changed files with 16 additions and 8 deletions
|
@ -3,13 +3,18 @@
|
|||
# this module installs mysql client software.
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# [*client_package_name*] - The name of the mysql client package.
|
||||
# Actions:
|
||||
#
|
||||
# Requires:
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
class mysql {
|
||||
package {"mysql-client": ensure => installed }
|
||||
class mysql(
|
||||
$client_package_name = $mysql::params::client_package_name
|
||||
) inherits mysql::params {
|
||||
package {"mysql-client":
|
||||
name => $client_package_name,
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,20 @@
|
|||
# Sample Usage:
|
||||
#
|
||||
class mysql::params{
|
||||
$socket = '/var/run/mysqld/mysqld.sock'
|
||||
$socket = '/var/run/mysqld/mysqld.sock'
|
||||
case $operatingsystem {
|
||||
'centos', 'redhat', 'fedora': {
|
||||
$service_name = 'mysqld'
|
||||
$service_name = 'mysqld'
|
||||
$client_package_name = 'mysql'
|
||||
}
|
||||
'ubuntu', 'debian': {
|
||||
$service_name = 'mysql'
|
||||
$service_name = 'mysql'
|
||||
$client_package_name = 'mysql-client'
|
||||
}
|
||||
default: {
|
||||
$python_package_name = 'python-mysqldb'
|
||||
$ruby_package_name = 'ruby-mysql'
|
||||
$python_package_name = 'python-mysqldb'
|
||||
$ruby_package_name = 'ruby-mysql'
|
||||
$client_package_name = 'mysql'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue