puppetlabs/puppetlabs-mysql — pull request #258 by apenney (2013-09-13 17:27:49+00:00)
Title: Completely redesign the MySQL module.

This work completely overhauls the MySQL module.

![image](https://f.cloud.github.com/assets/9492/1140075/30e7671e-1c98-11e3-88fe-47a9fd756790.png)

# Warning

I've been working on this for a week now, testing in a local vagrant instance. I don't have large scale MySQL environments to test upgrades from, I don't have clusters, I don't have sophisicated use cases for MySQL. This rewrite is currently LIGHTLY tested and the goal of merging it into master is to increase the pool of people who can help me test it, find the design flaws, add features, and generally get this into shape for a release. It is NOT ready to be released yet and I know that and need help to get it there.

# Overview

In an attempt to improve this module, make it easier to extend in future, and provide a better foundation for feature development I have attempted to refactor it completely.

Pretty much every API and class has been modified in some way. The heart of this proposed refactor is the idea that "It is impossible to adequately represent my.cnf through parameters." Previously we allowed you to set parameters like max_connections but then used that value in all my.cnf sections, and as experienced mysql users will tell you that can be unhelpful. You want different settings in `mysqldump` than in `mysqld` and this work supports that.

If you wish to customize my.cnf in this work you do:

```
class { 'mysql::globals':
override_options => {
'mysqld' => {
'max_connections' => '255'
},
'mysqldump' => {
'max_connections' => '10',
}
}
}

include 'mysql::server'
```
As you can see the hash for options is basically a bunch of top level sections as keys, then subhashes which contain the values under those sections.

# mysql::server changes

* Functionality broken into subclasses so we can apply ordering easier.
* The restart on changing root@localhost password is -removed-.
* We change the root@localhost password by mysql_user{} like everything else.
* $enabled and $manage_service are deprecated and renamed to $service_enabled and $service_manage.
* `remove_default_accounts` added as a parameter to automatically include mysql::server::account_security{}
* mysql::backup becomes mysql::server::backup and gets a few cleanups (and grows a $time parameter).
* mysql::server::config was previously a define for adding conf.d options - the define is gone and this is now the thing that manages the conf file.
* mysql::server::mysqltuner now writes the script to /usr/local/bin instead of /usr/bin.

# Other Changes

* mysql::bindings and subclasses get cleanups and all get switched to using distribution packages by default instead of gem. Also added php like all the others.
* mysql::client will let you pass in `enable_bindings` to automatically get -all- the bindings if you're feeling lazy.