Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MySQL bindings and client packages. #232

Merged
merged 1 commit into from
Jul 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions manifests/bindings.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Class: mysql::bindings
#
# This class installs various bindings for mysql.
#
# Parameters:
#
# [*java_enable*] - Boolean to determine if we should include the java bindings.
#
# [*perl_enable*] - Boolean to determine if we should include the perl bindings.
#
# [*python_enable*] - Boolean to determine if we should include the python bindings.
#
# [*ruby_enable*] - Boolean to determine if we should include the ruby bindings.
#
# [*java_package_name*] - The name of the java package containing the java connector
#
# [*java_package_ensure*] - State of the java binding packages.
#
# [*perl_package_ensure*] - State of the perl binding packages.
#
# [*perl_package_name*] - The name of the perl mysql package to install
#
# [*perl_package_provider*] - The provider to use when installing the perl package.
#
# [*python_package_ensure*] - State of the python binding packages.
#
# [*python_package_name*] - The name of the python mysql package to install
#
# [*ruby_ensure*] - State of the ruby binding packages.
#
# [*ruby_package_name*] - The name of the ruby mysql package to install
#
# [*ruby_package_provider*] - The provider to use when installing the ruby package.
#
class mysql::bindings (
# Boolean to determine if we should include the classes.
$java_enable = false,
$perl_enable = false,
$python_enable = false,
$ruby_enable = false,
# Settings for the various classes.
$java_package_ensure = $mysql::params::java_package_ensure,
$java_package_name = $mysql::params::java_package_name,
$perl_package_ensure = $mysql::params::perl_package_ensure,
$perl_package_name = $mysql::params::perl_package_name,
$perl_package_provider = $mysql::params::perl_package_provider,
$python_package_ensure = $mysql::params::python_package_ensure,
$python_package_name = $mysql::params::python_package_name,
$ruby_package_ensure = $mysql::params::ruby_package_ensure,
$ruby_package_name = $mysql::params::ruby_package_name,
$ruby_package_provider = $mysql::params::ruby_package_provider,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires puppet 2.7+. Is this change intentional or just an oversight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't say it's an intentional change but we're no longer actively supporting 2.6 in any way. It's beyond end of life and we're no longer testing modules against it or ensuring that it stays working. We'll take minor patches like dropping the last comma, but we're.. actively pushing for people to move up. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a minor patch, I created #235. We also started the discussion about supporting 2.6 in the foreman installer.

) inherits mysql::params {

if $java_enable { include '::mysql::bindings::java' }
if $perl_enable { include '::mysql::bindings::perl' }
if $python_enable { include '::mysql::bindings::python' }
if $ruby_enable { include '::mysql::bindings::ruby' }

}
8 changes: 4 additions & 4 deletions manifests/java.pp → manifests/bindings/java.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class: mysql::java
# Class: mysql::bindings::java
#
# This class installs the mysql-java-connector.
#
Expand All @@ -11,9 +11,9 @@
#
# Sample Usage:
#
class mysql::java (
$package_ensure = 'present',
$package_name = $mysql::java_package_name
class mysql::bindings::java (
$package_ensure = $mysql::bindings::java_package_ensure,
$package_name = $mysql::bindings::java_package_name
) inherits mysql {

package { 'mysql-connector-java':
Expand Down
10 changes: 5 additions & 5 deletions manifests/perl.pp → manifests/bindings/perl.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class: mysql::perl
# Class: mysql::bindings::perl
#
# installs the perl bindings for mysql
#
Expand All @@ -13,10 +13,10 @@
#
# Sample Usage:
#
class mysql::perl (
$package_ensure = 'present',
$package_name = $mysql::perl_package_name,
$package_provider = $mysql::perl_package_provider
class mysql::bindings::perl (
$package_ensure = $mysql::bindings::perl_package_ensure,
$package_name = $mysql::bindings::perl_package_name,
$package_provider = $mysql::bindings::perl_package_provider
) inherits mysql {

package{ 'perl_mysql':
Expand Down
8 changes: 4 additions & 4 deletions manifests/python.pp → manifests/bindings/python.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class: mysql::python
# Class: mysql::bindings::python
#
# This class installs the python libs for mysql.
#
Expand All @@ -12,9 +12,9 @@
#
# Sample Usage:
#
class mysql::python(
$package_ensure = 'present',
$package_name = $mysql::python_package_name
class mysql::bindings::python(
$package_ensure = $mysql::bindings::python_package_ensure,
$package_name = $mysql::bindings::python_package_name
) inherits mysql {

package { 'python-mysqldb':
Expand Down
10 changes: 5 additions & 5 deletions manifests/ruby.pp → manifests/bindings/ruby.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class: mysql::ruby
# Class: mysql::bindings::ruby
#
# installs the ruby bindings for mysql
#
Expand All @@ -13,10 +13,10 @@
#
# Sample Usage:
#
class mysql::ruby (
$package_ensure = 'present',
$package_name = $mysql::ruby_package_name,
$package_provider = $mysql::ruby_package_provider
class mysql::bindings::ruby (
$package_ensure = $mysql::bindings::ruby_package_ensure,
$package_name = $mysql::bindings::ruby_package_name,
$package_provider = $mysql::bindings::ruby_package_provider
) inherits mysql {

package{ 'ruby_mysql':
Expand Down
11 changes: 11 additions & 0 deletions manifests/client/install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class mysql::client::install(
$package_name = $mysql::client_package_name,
$package_ensure = $mysql::client_package_ensure
) {

package { 'mysql_client':
ensure => $package_ensure,
name => $package_name,
}

}
36 changes: 6 additions & 30 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#
# [*client_package_name*] - The name of the mysql client package.
#
# [*client_package_ensure*] - State of the client package.
#
# [*config_file*] - The location of the server config file
#
# [*config_template*] - The template to use to generate my.cnf.
Expand All @@ -22,8 +24,6 @@
#
# [*etc_root_password*] - Whether or not to add the mysql root password to /etc/my.cnf
#
# [*java_package_name*] - The name of the java package containing the java connector
#
# [*log_error*] - Where to log errors
#
# [*manage_config_file*] - if the config file should be managed (default: true)
Expand All @@ -38,10 +38,6 @@
#
# [*package_name*] - legacy parameter used to specify the client package. Should not be used going forward
#
# [*perl_package_name*] - The name of the perl mysql package to install
#
# [*perl_package_provider*] - The installation suite to use when installing the perl package.
#
# [*php_package_name*] - The name of the phpmysql package to install
#
# [*pidfile*] - The location mysql will expect the pidfile to be, and will put it when starting the service.
Expand All @@ -50,19 +46,12 @@
#
# [*purge_conf_dir*] - Value fed to recurse and purge parameters of the /etc/mysql/conf.d resource
#
# [*python_package_name*] - The name of the python mysql package to install
#
# [*restart*] - Whether to restart mysqld (true/false)
#
# [*root_group*] - Use specified group for root-owned files
#
# [*root_password*] - The root MySQL password to use
#
# [*ruby_package_name*] - The name of the ruby mysql package to install
#
# [*ruby_package_provider*] - The installation suite to use when installing the ruby package.
# FreeBSD Does not use this.
#
# [*server_package_ensure*] - ensure value for server packages.
#
# [*server_package_name*] - The name of the server package to install
Expand Down Expand Up @@ -91,33 +80,27 @@
$basedir = $mysql::params::basedir,
$bind_address = $mysql::params::bind_address,
$client_package_name = $mysql::params::client_package_name,
$client_package_ensure = $mysql::params::client_package_ensure,
$config_file = $mysql::params::config_file,
$config_template = $mysql::params::config_template,
$datadir = $mysql::params::datadir,
$tmpdir = $mysql::params::tmpdir,
$default_engine = $mysql::params::default_engine,
$etc_root_password = $mysql::params::etc_root_password,
$java_package_name = $mysql::params::java_package_name,
$log_error = $mysql::params::log_error,
$manage_config_file = true,
$manage_service = $mysql::params::manage_service,
$max_allowed_packet = $mysql::params::max_allowed_packet,
$old_root_password = $mysql::params::old_root_password,
$package_ensure = $mysql::params::package_ensure,
$package_name = undef,
$perl_package_name = $mysql::params::perl_package_name,
$perl_package_provider = $mysql::params::perl_package_provider,
$php_package_name = $mysql::params::php_package_name,
$pidfile = $mysql::params::pidfile,
$port = $mysql::params::port,
$purge_conf_dir = $mysql::params::purge_conf_dir,
$python_package_name = $mysql::params::python_package_name,
$max_connections = $mysql::params::max_connections,
$restart = $mysql::params::restart,
$root_group = $mysql::params::root_group,
$root_password = $mysql::params::root_password,
$ruby_package_name = $mysql::params::ruby_package_name,
$ruby_package_provider = $mysql::params::ruby_package_provider,
$server_package_name = $mysql::params::server_package_name,
$service_name = $mysql::params::service_name,
$service_provider = $mysql::params::service_provider,
Expand All @@ -127,16 +110,9 @@
$ssl_cert = $mysql::params::ssl_cert,
$ssl_key = $mysql::params::ssl_key
) 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':
ensure => $package_ensure,
name => $client_package_name_real,
}

include '::mysql::client::install'
include '::mysql::bindings'

Class['mysql::config'] -> Mysql::Db <| |>

Expand Down
Loading