Commit graph

424 commits

Author SHA1 Message Date
Ashley Penney
b81f64c8ab Rework templates to rely on the new hash and become vastly less complex. 2013-09-13 13:14:48 -04:00
Ashley Penney
4d6962e868 Various adjustments to classes to align with refactored work.
Handful of changes here, such as removing flush (so that mysql_user
can be used for root password changes) and other tweaks here.

Add time option to mysql::backup.
2013-09-13 13:14:48 -04:00
Ashley Penney
3f9297e10e Rework the mysql::bindings to be less complex.
This removes all the internal class parameters and shrinks these classes
to be more straightforward, relying on the values set in bindings.pp.
2013-09-13 13:14:39 -04:00
Ashley Penney
6a733e9503 Add a new function, mysql_strip_hash()
This is used in the backwards compatibility code in init.pp.
2013-09-13 13:10:21 -04:00
Ashley Penney
2c902b0f93 Add all the distribution specific params and other defaults not related
to the hash used in mysql::globals.
2013-09-13 13:09:48 -04:00
Ashley Penney
b930438d9a Deprecate this class while attempting to provide backwards
compatibility.
2013-09-13 13:09:05 -04:00
Ashley Penney
e4d5671e7f Add mysql::globals and refactor mysql::server.
This work adds a new mysql::globals class which contains a hash used to
build my.cnf from.  It's used to share this data across multiple classes
so that the client and server can share this data.

End users can modify content in my.cnf by including mysql::globals and
passing in override_options as a hash that looks like:

override_options = { 'mysqld' => { 'max_connections' => '120' } }

This completely replaces the mess of parameters that existed in the main
mysql class before.

Completely refactor mysql::server and rework the API.  This changes
ordering, changes from execs{} to mysql_user for the root password,
removes some functionality (like the etc_root_password), and generally
makes some tough decisions about how mysql::server should be built.
2013-09-13 13:04:42 -04:00
Ashley Penney
e3843ceb6f Refactor to use mysql::globals.
This initial round of work focuses on adding the concept of
mysql::globals to the module.  This is a shared place to provide all the
data the module needs, and then clients, servers, and providers can all
rely on this information to set things up.

This is being primarily used at first to allow a default_options hash
that contains all the previous parameters and takes a overrides_options
that allows you to then further customize any of the options in my.cnf.
2013-09-09 11:34:39 -04:00
Ashley Penney
52fb70ebde Merge pull request #248 from apenney/providers2
WIP: database_user and database refactoring
2013-09-06 08:43:36 -07:00
Ashley Penney
2abccab4d9 Refactor and rename database_grant to mysql_grant.
This provider has undergone the largest set of changes and currently
just accepts a full SQL grant string as the name and then applies it,
making things easier for DBAs and removes the awkward attempts at
modelling grants into Puppet.
2013-09-03 17:24:21 -04:00
Ashley Penney
351c722fbd Add rspec-system test for mysql_user. 2013-08-28 18:11:21 -04:00
Ashley Penney
88eea1708e Add simplecov support in order to generate test coverage. 2013-08-28 18:11:21 -04:00
Ashley Penney
596d005a98 Rework tests for mysql_password to extend coverage. 2013-08-28 18:11:21 -04:00
Ashley Penney
369c83126b Use new provider names in manifests.
Modify manifests and tests to handle the renamed providers.
2013-08-28 18:11:21 -04:00
Ashley Penney
16770faa29 Rename and refactor database_user to mysql_user.
This work adds max_connections_per_hour, max_queries_per_hour, and
max_updates_per_hour support to the provider and extends self.instances to add
in the new parameters when checking existing users.  It also adds
self.prefetch in order to speed up Puppet runs.

Provider is also switched to using mk_resource_methods to generate
all the resource readers, and exists? and other methods now use the
property_hash where appropriate.

Tests rewritten to handle changes and extend code coverage.
2013-08-28 18:11:21 -04:00
Ashley Penney
7d4f9fc685 Rename and refactor database to mysql_database.
Add collate as a new managable parameter, and extend self.instances to
add in all parameters when checking existing databases.  It also adds
self.prefetch in order to speed up Puppet runs.

Provider is also switched to using mk_resource_methods to generate
all the resource readers, and exists? and other methods now use the
property_hash where appropriate.

Tests rewritten to handle changes and extend code coverage.
2013-08-28 18:11:21 -04:00
Ashley Penney
4e649d7a83 Merge pull request #253 from treydock/mysqlbackup_file_per_database
Add option so mysql::backup to dump each database to its own file
2013-08-27 14:00:15 -07:00
Trey Dockendorf
627699fc49 Add option to mysql::backup to set the backup script to perform a mysqldump on each database to its own file 2013-08-27 15:15:29 -05:00
Ashley Penney
40db3e801d Merge pull request #244 from willametteuniversity/master
Added support to back up specified databases only with 'mysqlbackup'
2013-08-27 09:26:25 -07:00
Ashley Penney
3e7d7a2989 Merge pull request #245 from embeepea/master
Add HOME environment variable for .my.cnf to mysqladmin command
2013-08-27 09:24:30 -07:00
Casey Feskens
ad479e6a81 Changed backupdatabases default from false to [] 2013-08-15 06:04:14 -07:00
Mark Phillips
ae367272a2 Add HOME environment variable for .my.cnf to mysqladmin command when (re)setting root password 2013-08-14 15:48:56 -04:00
Casey Feskens
359d88175c Added support to back up specified databases only with 'mysqlbackup'
parameter.  Each database is backed up separately to a named file.
2013-08-13 14:44:41 -07:00
Ashley Penney
e2f3b54565 Merge pull request #243 from hunner/fix_sql
Add environment variable for .my.cnf and specs
2013-08-13 13:20:06 -07:00
Hunter Haugen
82c4b81ba3 Add environment variable for .my.cnf and specs 2013-08-13 13:08:39 -07:00
Ashley Penney
e0aed9f06b Merge pull request #237 from apenney/backwards-compat
Add compatibility classes to handle the backwards incompatible changes.
2013-07-27 11:33:12 -07:00
Ashley Penney
3026bab255 Merge pull request #238 from apenney/changelog-fix
Fix this so we don't list dates or versions yet.
2013-07-26 11:04:53 -07:00
Ashley Penney
52a7873286 Fix this so we don't list dates or versions yet. 2013-07-26 14:04:18 -04:00
Ashley Penney
c22e72a97a Add compatibility classes to handle the backwards incompatible changes. 2013-07-26 10:08:37 -04:00
Ashley Penney
144b03305c Merge pull request #236 from apenney/changelog
Update changelog.
2013-07-26 06:15:58 -07:00
Ashley Penney
50125689b1 Update changelog. 2013-07-26 09:13:32 -04:00
Ashley Penney
6370a81325 Merge pull request #235 from ekohl/puppet-2.6-compat
Fix puppet 2.6 compatibility
2013-07-25 06:20:01 -07:00
Ewoud Kohl van Wijngaarden
b1ae1523a4 Fix puppet 2.6 compatibility 2013-07-25 14:57:23 +02:00
Ashley Penney
1820b056f0 Merge pull request #232 from apenney/refactor-round-1
Refactor MySQL bindings and client packages.
2013-07-23 11:16:05 -07:00
Ashley Penney
7c7195ba33 Refactor MySQL bindings and client packages.
The current MySQL module is hard to modify, test, and drop in
replacement components to.  This work starts out by refactoring
the bindings support in MySQL to a completely seperate bindings
class in order to reduce the amount of parameters in the main
class for a feature that is infrequently used.

In addition to this start the movement of client configuration
and packages to the mysql::client::* namespace.
2013-07-19 18:39:55 -04:00
Hunter Haugen
b629655b4d Merge pull request #227 from hunner/pr174fix
Update my.cnf.pass.erb to allow custom socket support
2013-07-16 15:27:16 -07:00
Vincent Janelle
afb8561372 Fixing puppetlabs-mysql PR 174 spec tests 2013-07-16 15:01:58 -07:00
ThinkBriK
4edf5d48ec Update my.cnf.pass.erb 2013-07-16 15:00:53 -07:00
Ashley Penney
11ab036fed Merge pull request #225 from hunner/release_0.9.0
Release 0.9.0
2013-07-15 16:59:27 -07:00
Hunter Haugen
7407f148fc Release 0.9.0
Features:
- Add `mysql::backup::backuprotate` parameter
- Add `mysql::backup::delete_before_dump` parameter
- Add `max_user_connections` attribute to `database_user` type

Bugfixes:
- Add client package dependency for `mysql::db`
- Remove duplicate `expire_logs_days` and `max_binlog_size` settings
- Make root's `.my.cnf` file path dynamic
- Update pidfile path for Suse variants
- Fixes for lint
2013-07-15 16:55:13 -07:00
Ashley Penney
5431d78b19 Merge pull request #224 from 3flex/remove-redundant-parameter
Remove redundant hard coded replication parameters
2013-07-15 13:33:50 -07:00
Matthew Haughton
6bd91d04c1 Remove redundant my.cnf parameters
The following new `mysql` class replication parameters were added in 0.8.0, however the existing hard coded parameters were not removed from the my.conf.erb template:

- `expire_logs_days`
- `max_binlog_size`
2013-07-15 16:18:12 -04:00
Ashley Penney
096bd04f8b Merge pull request #222 from wolfspyre/iss_221
include mysql_client package as a requirement for the db creation
2013-07-15 08:25:27 -07:00
Wolf Noble
fb1e37cf04 package is specifically named 'mysql_client' not in relation to the client package name parameter. 2013-07-13 19:32:50 -05:00
Wolf Noble
19637d2e84 include mysql_client package as a requirement for the db creation 2013-07-12 18:06:53 -05:00
Ashley Penney
3205b83ac8 Merge pull request #219 from apenney/fixes
Fixes suggested by RubyMine (just playing around with it)
2013-07-11 16:43:46 -07:00
Ashley Penney
b00a6758a2 Simplify a few things. 2013-07-11 19:42:41 -04:00
Ashley Penney
4e6073de92 Fix a geninue potential issue, a non-quoted string. 2013-07-11 19:42:41 -04:00
Ashley Penney
4d3f73b550 Fixes suggested by RubyMine. (style for the most part.) 2013-07-11 19:42:41 -04:00
Ashley Penney
cc58668d19 Various fixes suggested by RubyMine. (style for the most part). 2013-07-11 19:41:42 -04:00