Skip to content

Instantly share code, notes, and snippets.

@stevenwilliamson
Created August 14, 2015 11:07
Show Gist options
  • Save stevenwilliamson/c10bc2125c573b1c6058 to your computer and use it in GitHub Desktop.
Save stevenwilliamson/c10bc2125c573b1c6058 to your computer and use it in GitHub Desktop.
class mysql::params{
# we have to figure out:
# - server package name
# - client package name
# - service name
# - p5-DBD major_version to install
# - any additional packages that need to be installed
# All based on a combination of major mysql version, operating system, mysql variant,
# and pkgsrc release
if $::operatingsystem == 'SmartOS' {
if $mysql::variant == 'mysql' {
if $mysql::major_version == '5.0' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql-client'
$service_name = 'mysql'
$p5_DBD_package_name = 'p5-DBD-mysql5'
}
if $mysql::major_version == '5.1' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql-client'
$service_name = 'mysql'
$p5_DBD_package_name = 'p5-DBD-mysql51'
}
if $mysql::major_version == '5.5' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql-client'
$service_name = 'mysql'
$p5_DBD_package_name = 'p5-DBD-mysql55'
}
}
if $mysql::variant == 'percona' {
if $mysql::major_version == '5.0' {
$server_package_name = 'percona-server'
$client_package_name = 'percona-client'
$service_name = 'percona'
$p5_DBD_package_name = 'p5-DBD-percona50'
}
if $mysql::major_version == '5.1' {
$server_package_name = 'percona-server'
$client_package_name = 'percona-client'
$p5_DBD_package_name = 'p5-DBD-percona51'
if $::pkgsrc_release == '2013Q2' {
$service_name = 'percona-server'
}
if $::pkgsrc_release == '2014Q2' {
$service_name = 'percona'
}
}
if $mysql::major_version == '5.5' {
$server_package_name = 'percona-server'
$client_package_name = 'percona-client'
$p5_DBD_package_name = 'p5-DBD-percona55'
if $::pkgsrc_release == '2013Q2' {
$service_name = 'percona-server'
}
if $::pkgsrc_release == '2014Q2' {
$service_name = 'percona'
}
}
}
} elsif $::operatingsystem == 'CentOS' {
if $mysql::variant == 'mysql' {
if $mysql::major_version == '5.0' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql'
$service_name = 'mysqld'
$p5_DBD_package_name = 'perl-DBD-MySQL'
}
if $mysql::major_version == '5.1' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql'
$service_name = 'mysqld'
$p5_DBD_package_name = 'perl-DBD-MySQL'
}
if $mysql::major_version == '5.5' {
$server_package_name = 'mysql-server'
$client_package_name = 'mysql'
$service_name = 'mysqld'
$p5_DBD_package_name = 'perl-DBD-MySQL'
}
}
if $mysql::variant == 'percona' {
if $mysql::major_version == '5.0' {
$server_package_name = 'Percona-Server-server-50'
$client_package_name = 'percona-client'
$service_name = 'mysql'
$p5_DBD_package_name = 'perl-DBD-MySQL'
$supporting_packages = [ 'Percona-Server-shared-compat' ]
}
if $mysql::major_version == '5.1' {
$server_package_name = 'Percona-Server-server-51'
$client_package_name = 'percona-client'
$p5_DBD_package_name = 'perl-DBD-MySQL'
$service_name = 'mysql'
$supporting_packages = [ 'Percona-Server-shared-compat' ]
}
if $mysql::major_version == '5.5' {
$server_package_name = 'Percona-Server-se
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment