From 9f74110cb6a6dcf111a3cdbec59d643e16466b0f Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 14 Dec 2015 17:13:32 -0800 Subject: [PATCH] Upgrade mysql module to 3.6.1 This patch upgrades the mysql module version as well as upgrading the usage of that module in openstack_project. This includes: - upgrading the syntax to set the root password - no longer setting bind_address anywhere since it defaults to 127.0.0.1 - upgrading the syntax to set the default storage engine using the new override_options param - upgrading the database and database_grant puppet resources to use the mysql_database and mysql_grant types. These types were renamed and are now more strict about how the title should look and what parameters need to be specified rather than inferred from the title. There is also no longer any reason to specify the 'mysql' provider since they gave up on the generic database provider idea. Changes to the system that we can expect: - /etc/mysql/my.cnf will have its parameters reordered. The key_buffer config parameter was renamed to key_buffer_size and the log_error parameter was renamed to log-error. Default values haven't changed. - The change in /etc/mysql/my.conf will trigger a mysql restart - /root/.my.cnf now adds single quotes around the password value. This won't change how mysql or the module reads the value, but puppet will report the file as having changed. This patch should not be merged until a downtime is prepared for the paste and wiki services. Change-Id: I8072e0aab03606307505e37fe6fb0c8b18eef854 Depends-On: I3ff754b15eef51c3c86c188647353a4a1d3bfea0 --- modules.env | 2 +- .../openstack_project/manifests/slave_db.pp | 35 ++++++++++--------- modules/openstack_project/manifests/wiki.pp | 11 +++--- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/modules.env b/modules.env index d6f43e0253..f56d269f76 100644 --- a/modules.env +++ b/modules.env @@ -56,7 +56,7 @@ SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-firewall"]="1.1.3" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-haproxy"]="5f638ef2dbf66fca67a1774dd8147e6eb596955c" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-inifile"]="1.1.3" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-java_ks"]="1.3.1" -SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-mysql"]="0.6.1" +SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-mysql"]="3.6.2" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-ntp"]="3.2.1" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-postgresql"]="3.4.2" SOURCE_MODULES["https://github.com/puppetlabs/puppetlabs-puppetdb"]="3.0.1" diff --git a/modules/openstack_project/manifests/slave_db.pp b/modules/openstack_project/manifests/slave_db.pp index c9a8067a86..404bf3edda 100644 --- a/modules/openstack_project/manifests/slave_db.pp +++ b/modules/openstack_project/manifests/slave_db.pp @@ -7,19 +7,21 @@ class openstack_project::slave_db( if ($::operatingsystem == 'Fedora') and ($::operatingsystemrelease >= 19) { class {'mysql::server': - config_hash => { - 'root_password' => $root_db_password, - 'default_engine' => 'MyISAM', - 'bind_address' => '127.0.0.1', + root_password => $root_db_password, + override_options => { + 'mysqld' => { + 'default-storage-engine' => 'MyISAM', + } }, package_name => 'community-mysql-server', } } else { class {'mysql::server': - config_hash => { - 'root_password' => $root_db_password, - 'default_engine' => 'MyISAM', - 'bind_address' => '127.0.0.1', + root_password => $root_db_password, + override_options => { + 'mysqld' => { + 'default-storage-engine' => 'MyISAM', + } }, } } @@ -41,27 +43,28 @@ class openstack_project::slave_db( # access to multiple databases and will fail if you try creating # a second DB with the same user. Create the DB directly as mysql::db # above is creating the user for us. - database { 'openstack_baremetal_citest': + mysql_database { 'openstack_baremetal_citest': ensure => present, charset => 'utf8', - provider => 'mysql', require => [ Class['mysql::server'], Class['mysql::server::account_security'], ], } - database_grant { 'openstack_citest@localhost/openstack_baremetal_citest': + mysql_grant { 'openstack_citest@localhost/openstack_baremetal_citest.*': privileges => ['all'], - provider => 'mysql', - require => Database_user['openstack_citest@localhost'], + user => 'openstack_citest@localhost', + table => 'openstack_baremetal_citest.*', + require => Mysql_user['openstack_citest@localhost'], } if ($all_mysql_privs == true) { - database_grant { 'openstack_citest@localhost': + mysql_grant { 'openstack_citest@localhost/*.*': privileges => ['all'], - provider => 'mysql', - require => Database_user['openstack_citest@localhost'], + user => 'openstack_citest@localhost', + table => '*.*', + require => Mysql_user['openstack_citest@localhost'], } } diff --git a/modules/openstack_project/manifests/wiki.pp b/modules/openstack_project/manifests/wiki.pp index 149dd49379..f297271625 100644 --- a/modules/openstack_project/manifests/wiki.pp +++ b/modules/openstack_project/manifests/wiki.pp @@ -40,11 +40,12 @@ class openstack_project::wiki ( udp_port => 11000, } class { 'mysql::server': - config_hash => { - 'root_password' => $mysql_root_password, - 'default_engine' => 'InnoDB', - 'bind_address' => '127.0.0.1', - } + root_password => $mysql_root_password, + override_options => { + 'mysqld' => { + 'default-storage-engine' => 'InnoDB', + } + }, } include mysql::server::account_security