From 2f8384069d123c1097fa09ec365aa97a49ce1d4f Mon Sep 17 00:00:00 2001 From: manashkin Date: Thu, 24 Jan 2013 22:47:09 +0400 Subject: [PATCH] Solved MySQL installation in simple installation scenario. --- deployment/puppet/mysql/manifests/init.pp | 2 +- deployment/puppet/mysql/manifests/params.pp | 14 +++++++++++++- deployment/puppet/mysql/manifests/server.pp | 16 ++++++++++++++-- deployment/puppet/mysql/templates/my.cnf.erb | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/deployment/puppet/mysql/manifests/init.pp b/deployment/puppet/mysql/manifests/init.pp index dff2ddd879..56743247ee 100644 --- a/deployment/puppet/mysql/manifests/init.pp +++ b/deployment/puppet/mysql/manifests/init.pp @@ -13,7 +13,7 @@ # class mysql ( $package_name = $mysql::params::client_package_name, - $package_ensure = 'present' + $package_ensure = $mysql::params::client_version ) inherits mysql::params { package { 'mysql_client': diff --git a/deployment/puppet/mysql/manifests/params.pp b/deployment/puppet/mysql/manifests/params.pp index fc285b656d..162d8db743 100644 --- a/deployment/puppet/mysql/manifests/params.pp +++ b/deployment/puppet/mysql/manifests/params.pp @@ -30,9 +30,13 @@ class mysql::params { 'RedHat': { $basedir = '/usr' $datadir = '/var/lib/mysql' - $service_name = 'mysqld' + $service_name = 'mysql' $client_package_name = 'MySQL-client' + $client_version = '5.5.28-6' $server_package_name = 'MySQL-server' + $server_version = '5.5.28-6' + $shared_package_name = 'MySQL-shared' + $shared_version = '5.5.28_wsrep_23.7' $socket = '/var/lib/mysql/mysql.sock' $pidfile = '/var/run/mysqld/mysqld.pid' $config_file = '/etc/my.cnf' @@ -52,7 +56,11 @@ class mysql::params { $datadir = '/var/lib/mysql' $service_name = 'mysql' $client_package_name = 'mysql-client' + $client_version = '5.5.28' $server_package_name = 'mysql-server' + $server_version = '5.5.28-23.7' + $shared_package_name = 'mysql-common' + $shared_version = '5.5.28' $socket = '/var/run/mysqld/mysqld.sock' $pidfile = '/var/run/mysqld/mysqld.pid' $config_file = '/etc/mysql/my.cnf' @@ -71,7 +79,11 @@ class mysql::params { $datadir = '/var/db/mysql' $service_name = 'mysql-server' $client_package_name = 'databases/mysql55-client' + $client_version = 'latest' $server_package_name = 'databases/mysql55-server' + $server_version = 'latest' + $shared_package_name = 'databases/mysql55-server' + $shared_version = 'latest' $socket = '/tmp/mysql.sock' $pidfile = '/var/db/mysql/mysql.pid' $config_file = '/var/db/mysql/my.cnf' diff --git a/deployment/puppet/mysql/manifests/server.pp b/deployment/puppet/mysql/manifests/server.pp index e7d36f9549..a967c31e8f 100644 --- a/deployment/puppet/mysql/manifests/server.pp +++ b/deployment/puppet/mysql/manifests/server.pp @@ -27,15 +27,27 @@ class mysql::server ( $galera_node_address = undef, $galera_nodes = undef ) inherits mysql::params { - + if ($custom_setup_class == undef) { + include mysql Class['mysql::server'] -> Class['mysql::config'] + Class['mysql'] -> Class['mysql::server'] create_resources( 'class', { 'mysql::config' => $config_hash } ) +# exec { "debug-mysql-server-installation" : +# command => "/usr/bin/yum -d 10 -e 10 -y install MySQL-server-5.5.28-6 2>&1 | tee mysql_install.log", +# before => Package["mysql-server"], +# logoutput => true, +# } package { 'mysql-server': name => $package_name, - ensure => $package_ensure, + ensure => $mysql::params::server_version, +# require=> Package['mysql-shared'], } +# package { 'mysql-client': +# name => $package_name, +# ensure => $mysql::params::client_version, +# } service { 'mysqld': name => $service_name, diff --git a/deployment/puppet/mysql/templates/my.cnf.erb b/deployment/puppet/mysql/templates/my.cnf.erb index c1a5010bf5..a9049f86d2 100644 --- a/deployment/puppet/mysql/templates/my.cnf.erb +++ b/deployment/puppet/mysql/templates/my.cnf.erb @@ -6,7 +6,7 @@ socket = <%= socket %> nice = 0 [mysqld] user = mysql -pid-file = <%= pidfile %> +#pid-file = <%= pidfile %> socket = <%= socket %> port = <%= port %> basedir = <%= basedir %>