From 7de2316e15117572c097d1d77a498f9ddb04be26 Mon Sep 17 00:00:00 2001 From: Damon Conway Date: Wed, 29 Oct 2014 14:59:59 -0500 Subject: [PATCH] [MODULES-1484] Add support for install_options for all package resources. Add install_options parameter to mysql::bindings, mysql::client, and mysql::server. The default is undef. --- README.md | 9 +++++++++ manifests/bindings.pp | 15 ++++++++------- manifests/bindings/client_dev.pp | 9 +++++---- manifests/bindings/daemon_dev.pp | 9 +++++---- manifests/bindings/java.pp | 7 ++++--- manifests/bindings/perl.pp | 7 ++++--- manifests/bindings/php.pp | 7 ++++--- manifests/bindings/python.pp | 7 ++++--- manifests/bindings/ruby.pp | 7 ++++--- manifests/client.pp | 1 + manifests/client/install.pp | 5 +++-- manifests/server.pp | 1 + manifests/server/install.pp | 5 +++-- 13 files changed, 55 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index d7fd5355b..7222d58c6 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,9 @@ Whether the MySQL configuration file should be managed. #####`includedir` The location of !includedir for custom configuration overrides. +#####`install_options` +Pass install_options array to managed package resources. You must be sure to pass the appropriate options for the correct package manager. + #####`purge_conf_dir` Whether the `includedir` directory should be purged. @@ -346,6 +349,9 @@ The hostname to allow to access the MySQL monitoring user. ####mysql::bindings +#####`install_options` +Pass install_options array to managed package resources. You must be sure to pass the appropriate options for the correct package manager. + #####`java_enable` Boolean to decide if the Java bindings should be installed. @@ -420,6 +426,9 @@ What provider should be used to install the package. Boolean to automatically install all bindings. +#####`install_options` +Pass install_options array to managed package resources. You must be sure to pass the appropriate options for the correct package manager. + #####`package_ensure` What to set the package to. Can be 'present', 'absent', or 'x.y.z'. diff --git a/manifests/bindings.pp b/manifests/bindings.pp index 40aa51d74..fa2c927f3 100644 --- a/manifests/bindings.pp +++ b/manifests/bindings.pp @@ -1,13 +1,14 @@ # See README.md. class mysql::bindings ( + $install_options = undef, # Boolean to determine if we should include the classes. - $java_enable = false, - $perl_enable = false, - $php_enable = false, - $python_enable = false, - $ruby_enable = false, - $client_dev = false, - $daemon_dev = false, + $java_enable = false, + $perl_enable = false, + $php_enable = false, + $python_enable = false, + $ruby_enable = false, + $client_dev = false, + $daemon_dev = false, # Settings for the various classes. $java_package_ensure = $mysql::params::java_package_ensure, $java_package_name = $mysql::params::java_package_name, diff --git a/manifests/bindings/client_dev.pp b/manifests/bindings/client_dev.pp index f8275039a..ee3c2fedd 100644 --- a/manifests/bindings/client_dev.pp +++ b/manifests/bindings/client_dev.pp @@ -3,12 +3,13 @@ if $mysql::bindings::client_dev_package_name { package { 'mysql-client_dev': - ensure => $mysql::bindings::client_dev_package_ensure, - name => $mysql::bindings::client_dev_package_name, - provider => $mysql::bindings::client_dev_package_provider, + ensure => $mysql::bindings::client_dev_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::client_dev_package_name, + provider => $mysql::bindings::client_dev_package_provider, } } else { warning("No MySQL client development package configured for ${::operatingsystem}.") } -} \ No newline at end of file +} diff --git a/manifests/bindings/daemon_dev.pp b/manifests/bindings/daemon_dev.pp index fe2db53ee..051535893 100644 --- a/manifests/bindings/daemon_dev.pp +++ b/manifests/bindings/daemon_dev.pp @@ -3,12 +3,13 @@ if $mysql::bindings::daemon_dev_package_name { package { 'mysql-daemon_dev': - ensure => $mysql::bindings::daemon_dev_package_ensure, - name => $mysql::bindings::daemon_dev_package_name, - provider => $mysql::bindings::daemon_dev_package_provider, + ensure => $mysql::bindings::daemon_dev_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::daemon_dev_package_name, + provider => $mysql::bindings::daemon_dev_package_provider, } } else { warning("No MySQL daemon development package configured for ${::operatingsystem}.") } -} \ No newline at end of file +} diff --git a/manifests/bindings/java.pp b/manifests/bindings/java.pp index d08083733..db93ac282 100644 --- a/manifests/bindings/java.pp +++ b/manifests/bindings/java.pp @@ -2,9 +2,10 @@ class mysql::bindings::java { package { 'mysql-connector-java': - ensure => $mysql::bindings::java_package_ensure, - name => $mysql::bindings::java_package_name, - provider => $mysql::bindings::java_package_provider, + ensure => $mysql::bindings::java_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::java_package_name, + provider => $mysql::bindings::java_package_provider, } } diff --git a/manifests/bindings/perl.pp b/manifests/bindings/perl.pp index 58c76f4b3..99d429c46 100644 --- a/manifests/bindings/perl.pp +++ b/manifests/bindings/perl.pp @@ -2,9 +2,10 @@ class mysql::bindings::perl { package{ 'perl_mysql': - ensure => $mysql::bindings::perl_package_ensure, - name => $mysql::bindings::perl_package_name, - provider => $mysql::bindings::perl_package_provider, + ensure => $mysql::bindings::perl_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::perl_package_name, + provider => $mysql::bindings::perl_package_provider, } } diff --git a/manifests/bindings/php.pp b/manifests/bindings/php.pp index 81d08d3aa..9af706962 100644 --- a/manifests/bindings/php.pp +++ b/manifests/bindings/php.pp @@ -2,9 +2,10 @@ class mysql::bindings::php { package { 'php-mysql': - ensure => $mysql::bindings::php_package_ensure, - name => $mysql::bindings::php_package_name, - provider => $mysql::bindings::php_package_provider, + ensure => $mysql::bindings::php_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::php_package_name, + provider => $mysql::bindings::php_package_provider, } } diff --git a/manifests/bindings/python.pp b/manifests/bindings/python.pp index 96a3882b3..a44c8fa15 100644 --- a/manifests/bindings/python.pp +++ b/manifests/bindings/python.pp @@ -2,9 +2,10 @@ class mysql::bindings::python { package { 'python-mysqldb': - ensure => $mysql::bindings::python_package_ensure, - name => $mysql::bindings::python_package_name, - provider => $mysql::bindings::python_package_provider, + ensure => $mysql::bindings::python_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::python_package_name, + provider => $mysql::bindings::python_package_provider, } } diff --git a/manifests/bindings/ruby.pp b/manifests/bindings/ruby.pp index f916f54c2..d431efedc 100644 --- a/manifests/bindings/ruby.pp +++ b/manifests/bindings/ruby.pp @@ -2,9 +2,10 @@ class mysql::bindings::ruby { package{ 'ruby_mysql': - ensure => $mysql::bindings::ruby_package_ensure, - name => $mysql::bindings::ruby_package_name, - provider => $mysql::bindings::ruby_package_provider, + ensure => $mysql::bindings::ruby_package_ensure, + install_options => $mysql::bindings::install_options, + name => $mysql::bindings::ruby_package_name, + provider => $mysql::bindings::ruby_package_provider, } } diff --git a/manifests/client.pp b/manifests/client.pp index 59487f700..2b84e5965 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,6 +1,7 @@ # class mysql::client ( $bindings_enable = $mysql::params::bindings_enable, + $install_options = undef, $package_ensure = $mysql::params::client_package_ensure, $package_name = $mysql::params::client_package_name, ) inherits mysql::params { diff --git a/manifests/client/install.pp b/manifests/client/install.pp index a443f5320..068fe2465 100644 --- a/manifests/client/install.pp +++ b/manifests/client/install.pp @@ -1,8 +1,9 @@ class mysql::client::install { package { 'mysql_client': - ensure => $mysql::client::package_ensure, - name => $mysql::client::package_name, + ensure => $mysql::client::package_ensure, + install_options => $mysql::client::install_options, + name => $mysql::client::package_name, } } diff --git a/manifests/server.pp b/manifests/server.pp index 2bd354053..23a76009e 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -2,6 +2,7 @@ class mysql::server ( $config_file = $mysql::params::config_file, $includedir = $mysql::params::includedir, + $install_options = undef, $manage_config_file = $mysql::params::manage_config_file, $old_root_password = $mysql::params::old_root_password, $override_options = {}, diff --git a/manifests/server/install.pp b/manifests/server/install.pp index f7736d586..daea460b7 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -2,8 +2,9 @@ class mysql::server::install { package { 'mysql-server': - ensure => $mysql::server::package_ensure, - name => $mysql::server::package_name, + ensure => $mysql::server::package_ensure, + install_options => $mysql::server::install_options, + name => $mysql::server::package_name, } # Build the initial databases.