restore package_name parameter to maintain backward compatibility.
Removal of the ambiguously named package_name parameter, without having a version provide a deprecation warning for a reasonable amount of time seems unreasonable. As Hunner suggests, adding a workaround variable to init.pp and use that as package name gives us the ability to warn users about the upcoming deprecation, while still maintaining backwards compatibility.
This commit is contained in:
parent
38a6954559
commit
78278f50b5
1 changed files with 10 additions and 2 deletions
|
@ -28,6 +28,8 @@
|
||||||
#
|
#
|
||||||
# [*old_root_password*] - Previous root user password,
|
# [*old_root_password*] - Previous root user password,
|
||||||
#
|
#
|
||||||
|
# [*package_name*] - legacy parameter used to specify the client package. Should not be used going forward
|
||||||
|
#
|
||||||
# [*package_ensure*] - ensure value for packages.
|
# [*package_ensure*] - ensure value for packages.
|
||||||
#
|
#
|
||||||
# [*php_package_name*] - The name of the phpmysql package to install
|
# [*php_package_name*] - The name of the phpmysql package to install
|
||||||
|
@ -86,6 +88,7 @@ class mysql(
|
||||||
$log_error = $mysql::params::log_error,
|
$log_error = $mysql::params::log_error,
|
||||||
$manage_service = $mysql::params::manage_service,
|
$manage_service = $mysql::params::manage_service,
|
||||||
$old_root_password = $mysql::params::old_root_password,
|
$old_root_password = $mysql::params::old_root_password,
|
||||||
|
$package_name = undef,
|
||||||
$package_ensure = $mysql::params::package_ensure,
|
$package_ensure = $mysql::params::package_ensure,
|
||||||
$php_package_name = $mysql::params::php_package_name,
|
$php_package_name = $mysql::params::php_package_name,
|
||||||
$pidfile = $mysql::params::pidfile,
|
$pidfile = $mysql::params::pidfile,
|
||||||
|
@ -105,10 +108,15 @@ class mysql(
|
||||||
$ssl_cert = $mysql::params::ssl_cert,
|
$ssl_cert = $mysql::params::ssl_cert,
|
||||||
$ssl_key = $mysql::params::ssl_key,
|
$ssl_key = $mysql::params::ssl_key,
|
||||||
) inherits mysql::params{
|
) inherits mysql::params{
|
||||||
|
if $package_name {
|
||||||
|
warning('Using $package_name has been deprecated in favor of $client_package_name and will be removed.')
|
||||||
|
$client_package_name_real = $package_name
|
||||||
|
} else {
|
||||||
|
$client_package_name_real = $client_package_name
|
||||||
|
}
|
||||||
package { 'mysql_client':
|
package { 'mysql_client':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
name => $client_package_name,
|
name => $client_package_name_real,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue