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
This commit is contained in:
Colleen Murphy 2015-12-14 17:13:32 -08:00
parent 558e4b68b4
commit 9f74110cb6
3 changed files with 26 additions and 22 deletions

View File

@ -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"

View File

@ -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'],
}
}

View File

@ -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