Commit graph

369 commits

Author SHA1 Message Date
Morgan Haskel
6151590caf Change the package name in the manifest, too! 2014-05-09 16:46:03 -04:00
Morgan Haskel
dec2af67b8 MariaDB still uses my.cnf as the main config file. 2014-05-09 15:10:27 -04:00
nerdlich
b40865d740 Backup user needs PROCESS privilege when doing file-per-database backups
The following error occured:
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `INNODB_BUFFER_PAGE`': Access denied; you need (at least one of) the PROCESS privilege(s) for this operation (1227)
2014-04-22 13:08:58 +02:00
Ashley Penney
71d1f24bd9 Merge pull request #457 from igalic/independent-backup
mysqlbackup.sh should be able to find mysql
2014-04-10 13:46:19 -04:00
Martin Magr
c47d1fb586 Modified params.pp to work on latest Red Hat releases
On Fedora-20+ and RHEL-7+ mysqld service does not work any more
and has been replaced by mariadb service. This patch changes all
parameters accordingly.
2014-03-18 17:34:54 +01:00
Pan
df706eec5e Use ensure_resource for mysql_databasein mysql::db
This will allow exported resource mysql::db to define same database but different
hostname and enables the cluster web nodes to declear the mysql::db and
to be collected on db node.
2014-03-15 13:38:17 -07:00
Pan
2834498e4d Allow use different name for db resource other than db name
When defining the mysql::db as exported resources, there are chances that the
same resource names are defined across the site, which will cause puppet agent
fail. By adding an optional dbname parameter, default to the $name, it allows the
resouce name to be defined differently, e.g. ${dbname}_${domain}.
Also updated test and docs for dbname parameter and add acceptance test for
dbname parameter feature
2014-03-15 13:38:13 -07:00
Robin Gloster
47521aea8e add message to warn if disabling ssl 2014-03-04 14:58:17 +01:00
Robin Gloster
abcea00dcb handle mysql compiled without ssl
mysql doesn't allow ssl=true/false in my.cnf if it hasn't been compiled
with ssl, therefor add a new parameter ssl-disable which makes sure the
template doesn't write anything with ssl to the config.
2014-02-28 21:42:41 +01:00
Ashley Penney
2d1a9f981a This fixes:
* Bindings on SLES
* Makes sure we don't kill the service while testing conf file locations.
2014-02-26 14:54:54 +00:00
Igor Galić
d2b24e40d3 mysqlbackup.sh should be able to find mysql
anywhere. This should enable use to use mysql::server::backup
idependantly, even if mysql is preinstalled, and preinstalled in non
standard locations
2014-02-20 17:17:41 +01:00
Igor Galić
63e0da0b71 option to specify a script that runs after backups
This script could be used to sync backups to a central server, or just
to create a file to let external scripts know that backups are
(sucessfully) done and can be picked up.

The postscript option (defaults to false) and can be either a string or
an array of strings. These strings will be directly put into the
mysqlbackup.sh and as such can either be shell commands, or externally
managed files.
2014-02-06 16:44:07 +01:00
John Bond
10f346eaca Add logic to ignore mysql.events 2014-01-30 12:31:21 +01:00
Jim Radford
dabb29dd6e Actually use upstart on Ubuntu by fixing misspelled variable name 2014-01-23 13:01:08 -08:00
Ashley Penney
edfaeccfa8 Merge pull request #394 from danielfoglio/master
changed log_error to log-error and pid_file to pid-file to match the mys...
2013-12-19 16:39:56 -08:00
Igor Galić
d5fd46de59 Merge pull request #400 from duritong/fix_backupuser_dependency
Fix backupuser dependency
2013-12-18 22:13:27 -08:00
Ashley Penney
c32ae645e0 Apparently we were restarting no matter what the parameter said,
awkward.
2013-12-18 15:12:04 -05:00
Ashley Penney
5bba2e04b3 Add a comment to make this clearer. 2013-12-18 14:13:00 -05:00
Ashley Penney
b7dcdd1714 Add $restart support.
Previously this parameter did nothing, lets make it actually work.
2013-12-18 13:59:56 -05:00
mh
765afe4f61 Fix #321 - root_user should be setup before configuring backup user
Otherwise puppet might try to setup the backup user even before
the service is running and will fail.
2013-12-18 13:35:20 +01:00
Foglio, Daniel
3d98b1de0d changed log_error to log-error and pid_file to pid-file to match the mysqld service script 2013-12-17 17:39:04 -05:00
Guillaume Virlet
3da12ac622 migrate key_buffer (deprecated) to key_buffer_size in config_file 2013-12-14 23:15:13 +01:00
Guillaume Virlet
9460db2ec1 fix typo on bind-address in config_file 2013-12-14 23:14:01 +01:00
Evan Heidtmann
c654fe1ba8 Parameterize backup directory mode and ownership 2013-11-15 20:55:21 -08:00
Mason Malone
b86de6b88e Comment mysql::server::providers and update README.md
I added a "$" to the parameter examples because the Github syntax highlighting
looks off without it.
2013-11-11 09:57:31 -05:00
Mason Malone
d66efd82a2 Better hiera integration
This adds hash parameters to mysql::server to allow specifying grants, users, and databases to
create automatically, which works nicely with Hiera's automatic parameter lookup functionality
2013-11-10 22:25:55 -05:00
Ashley Penney
52b8714081 Fix owner -> user typo. 2013-11-06 11:36:55 -05:00
Igor Galić
333be5fd76 ensure /root/.my.cnf is 0600 and root owned
explicitly set /root/.my.cnf's owner and mode to ensure it will be
created with as root owned and 0600. This change fixes #357
2013-11-05 19:56:27 +01:00
Ashley Penney
a4d329f846 Fix the broken anchoring. 2013-11-05 16:41:41 +01:00
Jonathan Machado
62ef6564d7 Update the Anchor pattern workaround
Add a step to the anchor pattern and add comment to clarify the need of this workaround.
Ref : http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
2013-10-31 13:16:32 +09:00
Jonathan Machado
e7c26a1c57 Add Anchor pattern to client.pp
The class mysql::client::install is "contained" in the mysql::client to avoid floating.
2013-10-29 19:24:04 +09:00
Ashley Penney
91b068cad4 Fix description for PE3.1
In PE3.1 it parses the comment #Deprecated at the top of the parameters
as if it's the class description.  Move this so PE3.1 doesn't falsely
claim mysql::server is now deprecated.
2013-10-16 11:42:35 -04:00
Ashley Penney
5d17f10f93 Port of a6101dc (mysql::server::monitor fix) to 2.x. 2013-10-07 09:55:13 -04:00
Ashley Penney
52a9f2e293 Duplicate parameter removed. 2013-10-03 19:10:35 -04:00
Ashley Penney
c0b35a2cf7 Add all the params here as undef to make it clear what the intent is. 2013-10-03 17:15:24 -04:00
Ashley Penney
dec3e1f7f1 Fix typoed parameter. 2013-09-30 13:04:15 -04:00
Ashley Penney
17597bf261 Merge pull request #282 from mediatemple/fix/master/merge_function
Fixes issue #274 by using recursive hash merge.
2013-09-26 06:57:16 -07:00
Ashley Penney
1719424b23 Fix mysql::client.
This was still relying on globals.  Allow you to pass params into
mysql::client properly to set the package.
2013-09-26 09:30:44 -04:00
Justin Burnham
1b4a486bf9 Fixes issue #274 by using recursive hash merge. 2013-09-25 10:38:08 -07:00
Ashley Penney
e0c4434815 Merge pull request #280 from apenney/fix-php
Removing the bindings compat stuff.
2013-09-25 10:07:27 -07:00
Ashley Penney
b8261abbdf Removing the bindings compat stuff. 2013-09-25 12:48:14 -04:00
Ashley Penney
46fe1ea512 Remove mysql::globals.
This turned out to be a fairly bad idea.  It begun as a way to try
and mirror what happens in the postgresql module for consistency
but instead made things complex.

I've changed it to have the override_options in mysql::server which
leads much more naturally out of the design and shape of MySQL.
2013-09-24 18:04:29 -04:00
David Collom
0614fba911 Update mysqltuner.pp
Enable present/absence.. in those cases when you only want mysqltuner installed for debugging
2013-09-24 14:43:11 +01:00
Ashley Penney
9d0f9010c6 Merge pull request #241 from red-trela/support-fedora-rawhide
Support Fedora's rolling development "release", Rawhide
2013-09-23 14:09:16 -07: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
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
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
369c83126b Use new provider names in manifests.
Modify manifests and tests to handle the renamed providers.
2013-08-28 18:11:21 -04: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
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
Hunter Haugen
82c4b81ba3 Add environment variable for .my.cnf and specs 2013-08-13 13:08:39 -07:00
Sandro Mathys
070daf86b4 Support Fedora's rolling development "release", Rawhide
Since Rawhide is a rolling kind of release with no version numbers,
the operatingsystemrelease will actually return "Rawhide" instead
of any Integer. So we better check whether operatingsystemrelease
is an Integer before comparing numbers and cover Rawhide, too.
2013-08-11 18:25:33 +02:00
Ashley Penney
c22e72a97a Add compatibility classes to handle the backwards incompatible changes. 2013-07-26 10:08:37 -04:00
Ewoud Kohl van Wijngaarden
b1ae1523a4 Fix puppet 2.6 compatibility 2013-07-25 14:57:23 +02: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
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
4e6073de92 Fix a geninue potential issue, a non-quoted string. 2013-07-11 19:42:41 -04:00
Ashley Penney
926e94a4cb Merge pull request #170 from omalashenko/master
Harden mysqlbackup.sh script
2013-07-09 16:06:55 -07:00
Ashley Penney
9bc2eb67c7 Merge pull request #214 from paramite/roothome
Use $root_home for .my.cnf
2013-07-09 16:04:23 -07:00
Clemens Fuchslocher
2e82660446 Fixed PID file location for SLES 11 SP2. 2013-07-08 20:50:43 +02:00
Martin Magr
e3d74a65b0 Use $root_home for .my.cnf 2013-07-08 11:49:30 +02:00
Derek Higgins
48af8a727d Fix typo in fact name 2013-07-06 00:08:02 +01:00
Ashley Penney
2b91872407 Merge pull request #210 from red-trela/fedora-19-mariadb
Cover Fedora 19's move from mysql to mariadb packages
2013-07-05 09:56:59 -07:00
Sandro Mathys
3ca7d958df Cover Fedora 19's move from mysql to mariadb packages 2013-07-05 10:53:56 +02:00
Daniel De Marco
e12eb0e19f add ft_min_word_len and ft_max_word_len config options 2013-07-04 21:33:53 -04:00
Oleg Malashenko
d7460d4b02 backup: configurable cleanup sequence
$delete_before_dump controls whether old backups to be removed before
creating new one.
2013-07-05 11:27:29 +10:00
Oleg Malashenko
9e2540f4fc Harden mysqlbackup.sh script
* mysql::backup backuprotate parameter sets the number of backups to keep,
   default is 30.

 * Use bash in mysqlbackup.sh to get exit status of mysqldump when piped to
   bzip2. Unfortunately there is no easy portable way to do that.

 * Only delete old backups when current backup finished successfully.

 * Try hard not to delete files that we didn't create (i.e. README or other
   backups).
2013-07-05 11:27:29 +10:00
Lebedev Vadim
9d69afcae7 Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql
Conflicts:
	manifests/config.pp
	spec/classes/mysql_config_spec.rb
2013-07-02 22:11:19 +04:00
Ashley Penney
aa5d1f070b Merge pull request #198 from mhellmic/maxconnections
add a maximum connection parameter and set the default to 1000
2013-07-02 10:43:29 -07:00
Lebedev Vadim
6cef2e8af4 Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql 2013-07-02 21:42:49 +04:00
Ashley Penney
f3e5c89551 Merge pull request #187 from RsrchBoy/topic/perl
add mysql::perl helper class
2013-07-02 10:37:10 -07:00
Ashley Penney
1b5dc3ce68 Merge pull request #186 from apenney/rootpassword
(WIP) #20562: Minor fix for ordering
2013-07-02 10:36:31 -07:00
Lebedev Vadim
ead86b5a3f Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql
Conflicts:
	manifests/config.pp
2013-07-02 21:26:43 +04:00
Ashley Penney
d9ce083f20 Merge pull request #162 from frimik/19744
fixes #19744 - no restart on root/.my.cnf change
2013-07-02 09:56:10 -07:00
Simon Effenberg
7f7e886d71 handling of my.cnf config file is now optional
This adds a parameter (default value is like old behavior) so that the
my.cnf file isn't managed (created/updated) by the mysql module at all
which is necessary for our environment. We need to set all parameters by
ourself. If we don't set a parameter then the default from the mysqld
binary should be used instead of any default parameter the mysql module
provides us.
2013-07-02 10:01:21 +02:00
Martin Hellmich
880eaae3e8 changed the max_connections default to 151
this is the default according to the mysql manual.
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections
2013-06-28 11:21:58 +02:00
Martin Hellmich
3089d3a59b add a maximum connection parameter and set the default to 1000
Conflicts:
	manifests/config.pp
	templates/my.cnf.erb
2013-06-28 10:15:58 +02:00
Lebedev Vadim
a42d5bea53 Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql 2013-06-26 14:06:01 +04:00
Niek Beernink
9dc1b946de make tmpdir configurable 2013-06-25 15:06:07 -07:00
Lebedev Vadim
fad4f06cb2 * Fixing lint warnings 2013-06-17 18:04:55 +04:00
Chris Weyl
beeb261c5a Merge branch 'master' into topic/perl
Conflicts:
	manifests/init.pp
2013-05-27 15:23:55 -07:00
Ashley Penney
811ebc62c8 A very small fix for the case where the root password has been changed
by hand and then you change your mysql::server entry to match.  If you
also change any mysql::db entries at the same time this causes those to
be attempted before your /root/.my.cnf is updated.

I can't add rspec testing for this until https://github.com/rodjek/rspec-puppet/pull/106
is merged.
2013-05-25 21:33:29 -04:00
Lebedev Vadim
1a13580f49 Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-mysql
Conflicts:
	manifests/config.pp
	manifests/params.pp
2013-05-21 20:40:50 +04:00
Lebedev Vadim
a171c52a89 * Puppet 2.6 fix 2013-05-21 01:21:38 +04:00
Mark Smith-Guerrero
242f6e5881 parameterized previously hardcoded max_allowed_packet config setting 2013-05-06 15:55:53 -04:00
Wolf Noble
cf78bea206 minor fix to alphabetization of package_ensure parameter 2013-05-03 17:06:06 -05:00
Wolf Noble
569448c0a6 Fix missing python_package_name parameter 2013-05-03 17:00:52 -05:00
Chris Weyl
fac48b8584 add mysql::perl
An additional helper class to ensure that the Perl MySQL DBD driver is
installed (DBD::mysql).
2013-05-03 09:25:30 -07:00
Francois Deppierraz
391abe753f Fix default-storage-engine default value
Without this commit, puppetlabs-mysql breaks mysql configuration by inserting a
dummy default-storage-engine directive. This will prevent mysql daemon from
starting up.

For example:

notice: /Stage[main]/Mysql::Config/File[/etc/mysql/my.cnf]/content:
--- /etc/mysql/my.cnf   2013-04-25 21:36:25.000000000 +0000
+++ /tmp/puppet-file20130425-12937-10tcf50-0    2013-04-25 21:42:49.000000000 +0000
@@ -29,6 +29,8 @@
 expire_logs_days   = 10
 max_binlog_size    = 100M

+default-storage-engine = undef
+

 [mysqldump]
2013-04-25 23:46:34 +02:00
Wolf Noble
e65775cd3d Removal of trailing commas to the last parameter of classes for backwards compatibility with Puppet2.6 2013-04-24 17:02:46 -05:00
Wolf Noble
2deb2b2da3 Remove trailing comma to server.pp for 2.6 backwards compatibility. 2013-04-24 15:38:05 -05:00
Wolf Noble
78278f50b5 restore package_name parameter to maintain backward compatibility.
Removal of the ambiguously named package_name parameter, without having a version provide a deprecation warning for a reasonable amount of time seems unreasonable.
As Hunner suggests, adding a workaround variable to init.pp and use that as package name gives us the ability to warn users about the upcoming deprecation, while still maintaining backwards compatibility.
2013-04-24 15:35:08 -05:00
Wolf Noble
38a6954559 Fix to config.pp. Remove trailing , on last parameter, which breaks in puppet 2.6
Fix to config.pp. Remove trailing , on last parameter, which breaks in puppet 2.6
2013-04-24 15:14:19 -05:00
Wolf Noble
b79477d57d Out of scope of this refactor
we don't need these defines for this refactor. Removing for simplicity's sake
2013-04-16 13:45:07 -05:00
Wolf Noble
33e2a45000 Some minor fixes to appease puppet lint 2013-04-11 12:02:41 -05:00
Wolf Noble
0f6886bd99 Refactor of classes to put everything as a param to mysql to prepare for autoloading from hiera
put a handle on all the params of the class in init.pp so that they can be autoloaded from hiera, and easily fed to the class from a profile class
2013-04-09 13:45:55 -05:00
Lebedev Vadim
5ea8e5f920 * Adding server_idparameter to mysql::config`
* Adding `sql_log_bin` parameter to `mysql::config`
* Adding `log_bin` parameter to `mysql::config`
* Adding `max_binlog_size` parameter to `mysql::config`
* Adding `binlog_do_db` parameter to `mysql::config`
* Adding `expire_logs_days` parameter to `mysql::config`
* Adding `log_bin_trust_function_creators` parameter to `mysql::config`
* Adding `replicate_ignore_table` parameter to `mysql::config`
* Adding `replicate_wild_do_table` parameter to `mysql::config`
* Adding `replicate_wild_ignore_table` parameter to `mysql::config`
* Adding `expire_logs_days`  parameter to `mysql::params`
* Adding `max_binlog_size` parameter to `mysql::params`
2013-04-08 19:23:24 +04:00
Lebedev Vadim
2a1b1e7962 * Adding key_buffer parameter to mysql::config
* Adding `thread_stack` parameter to `mysql::config`
* Adding `thread_cache_size` parameter to `mysql::config`
* Adding `myisam-recover` parameter to `mysql::config`
* Adding `query_cache_limit` parameter to `mysql::config`
* Adding `query_cache_size` parameter to `mysql::config`
* Adding `max_connections` parameter to `mysql::config`
* Adding `tmp_table_size` parameter to `mysql::config`
* Adding `table_open_cache` parameter to `mysql::config`
* Adding `long_query_time` parameter to `mysql::config`
* Updating mysql_config spec tests
* Fixing lint warnings
2013-04-08 00:20:36 +04:00
Lebedev Vadim
e3b6de2da2 Implement character_set. You can change the default server and
client character set
2013-04-04 14:02:58 +04:00
Wolf Noble
43352709b2 Merge branch 'master' of git://github.com/puppetlabs/puppetlabs-mysql 2013-04-03 15:57:53 -05:00
Dominic Cleal
3d1703fc7f Move hash outside of function call, fixes for Puppet 2.6 2013-03-21 23:59:27 +00:00
Mikael Fridh
629c6ce31c fixes #19744 - no restart on root/.my.cnf change 2013-03-14 14:08:29 +01:00
Paul Chechetin
1d6ca771d4 Fix issue with twice declaration of Database_user resource 2013-02-18 15:24:57 +04:00
Hunter Haugen
3fbcf433b7 Merge pull request #136 from deadpoint/master
Added SuSE support to puppetlabs-mysql
2013-01-09 13:04:44 -08:00
Hunter Haugen
d5bf7a19f7 Merge pull request #131 from saz/recurse-conf-dir
add parameter to remove old files in conf.d dir
2013-01-09 13:01:13 -08:00
Gary Larizza
5b4e9763c7 Merge pull request #137 from hunner/php_support
Add php support
2013-01-09 12:22:01 -08:00
Wolf Noble
cf396cbded create defined types for grant and user 2013-01-04 13:35:59 -06:00
Hunter Haugen
02c4da48a5 Add php support
PHP libraries are required by many apps. This class assumes 'normal'
names for these packages, but allows other packages names to be passed
for variances such as 'php53-mysql' on RedHat and FreeBSD.
2013-01-04 10:59:17 -08:00
Darin Perusich
0d0c52430b Added support for SuSE systems 2013-01-03 12:22:39 -05:00
Nikola Petrov
723a3affa1 Update manifests/server/monitor.pp
We are using this manifest file and it cannot find *Mysql_user* please change it to *Database_user*. I suppose that this was changed after a refactoring of some sort


Best, Nikola
2012-12-12 18:54:51 +02:00
Steffen Zieger
c5a4740883 add parameter to remove old files in conf.d dir 2012-11-16 20:49:24 +01:00
Dan Bode
649bc16416 account security should not fail if hostname == fqdn
This commit checks that hostaname and fqdn are not
equal before trying to remove both.
2012-10-28 21:40:11 -07:00
Dan Bode
d6b77170d5 fix mysql bug 2012-10-14 19:17:37 -07:00
Ryan Coleman
5a167c9eef Merge pull request #125 from bodepd/create_my_cnf
Create /root/.my.cnf even when root passwd is not managed
2012-10-13 10:14:23 -07:00
Ryan Coleman
bb4f15b8fe Merge pull request #117 from hunner/optional_compression
Mysql::backup Compression Optional
2012-10-13 10:09:55 -07:00
Dan Bode
765b5c2527 Create /root/.my.cnf even when root passwd is not managed
When the root password is not managed, it causes mysql to
fail b/c it does not create the /root/.my.cnf file (which causes
all mysql commands from the provider to fail)
2012-10-13 02:35:38 -07:00
Dan Bode
c84ffdeef0 Merge pull request #122 from hunner/optional_service
Optionally manage the mysqld service
2012-10-04 17:03:30 -07:00
Hunter Haugen
c4e0e64782 Optionally manage the mysqld service
When using failover options such as Corosync, it's preferable to allow the failover software to manage the starting and stopping of the service. This parameter allows that to happen.
2012-10-04 16:20:07 -07:00
Simon Effenberg
612ee9884d Only a simple documentation fix. 2012-10-03 09:22:03 +02:00
Justin Brown
af30a52182 Backup Compression Optional
Added a parameter to mysql::backup to make bzip2 compression
optional. Compression is enabled by default, so current behavior
is not affected.

Rationale:
We are storing our MySQL backups on a system with deduplication.
Compression and dedup do not play well together, so it's advantagous
to be able to disable it.
2012-09-26 13:40:59 -07:00
Mikael Fridh
063b8c097c Minor rdoc fixes in mysql::config class 2012-09-08 12:12:27 +02:00
Mikael Fridh
af58059903 Make service restarts optional
Useful if you prefer to not have your mysql service touched after it is
running.
2012-09-08 12:09:44 +02:00
Hunter Haugen
d98efe3b7a Merge pull request #113 from janoszen/ipv6
IPv6
2012-09-05 11:01:12 -07:00
Dan Bode
88164421b6 Merge pull request #114 from dalen/immutable_variables
Don't assign to hash after creation
2012-09-05 07:57:46 -07:00
Erik Dalén
fa1915b2e5 Don't assign to hash after creation
We shouldn't modify a variable after creating it. It is just a bug that
it is possible at all.
2012-09-05 16:43:11 +02:00
Janos Pasztor
e77576d8e7 Added spec for IPv6 changes as requested by upstream 2012-09-05 09:58:42 +02:00
Janos Pasztor
0c07e42427 Added IPv6 localhost to account_security 2012-09-04 21:42:07 +02:00
Hunter Haugen
5e8f98b5d2 Merge pull request #108 from Paulche/master
Add show view privilege for backup user

This is valid for database dumps which contain views, as per http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
2012-09-04 11:18:43 -07:00
Erik Dalén
b670071d9f Fix lint warnings 2012-09-04 16:25:08 +02:00
Paul Chechetin
f1b6495490 Add show_view_privilege for backup user 2012-09-03 16:53:59 +04:00
Hunter Haugen
0e4de09934 Merge pull request #93 from Savar/master
new config define and a small bugfix
2012-08-29 11:54:58 -07:00
Simon Effenberg
e27cff0bd9 fixed typo 2012-08-24 08:06:17 +02:00
Simon Effenberg
e47b4d19e7 fixed documentation and added rspec
* fixed a typo in the documentation
* added documentation for parameter +notify_service+
* added rspec test
2012-08-24 08:01:33 +02:00
Derek Higgins
06fe2fdbd2 Change list passed into validate_re to a stringe
The list was causing a syntax error on puppet puppet 2.6.17
2012-08-23 10:04:30 +01:00
Simon Effenberg
1fb0c273a8 fixed .my.cnf path
* rollback for the file location + updated the documentation
2012-08-23 07:36:30 +02:00
Hunter Haugen
bfd19998d1 Merge pull request #101 from martasd/manage-db-status
Added an option to specify db status.
2012-08-22 11:30:46 -07:00
Eugene Kirpichov
6869b77541 Parameterized pidfile; critical for successful first restart 2012-08-21 18:32:34 -07:00
Martin Dluhos
04537908a9 Added an option to specify db status. 2012-08-21 15:40:42 -07:00
Dan Bode
211da13545 Revert "Merge pull request #90 from emonty/master"
This reverts commit 063d72493c, reversing
changes made to 9c10b3a6c3.
2012-08-15 18:03:37 -07:00
Dan Bode
063d72493c Merge pull request #90 from emonty/master
Add a bunch of new parameters
2012-08-15 17:40:42 -07:00
Branan Purvine-Riley
02695533c8 Put that curly brace in the right place this time 2012-08-14 10:09:33 -07:00
Branan Purvine-Riley
1da8ae7a28 Add a missing curly brace 2012-08-14 09:58:35 -07:00
Nick Osborn
65f72ad317 Add support for Amazon Linux. 2012-08-13 17:26:01 -07:00
Simon Effenberg
f13482bde2 New configuration define.
* added a define to easily create .cnf files in /etc/mysql/conf.d/
* fix wrong path for .my.cnf in /etc/
2012-08-13 10:59:28 +02:00
Monty Taylor
8d97f5dca8 Add apparmor support. 2012-08-12 08:48:19 -04:00
Michael Arnold
605fa718e1 Escape $root_password during execs.
Some characters used in a password can cause the shell in an exec to do
unexpected things unless the password is enclosed in single quotes.
Updated the rspec tests to deal with the password quoting.
2012-08-09 00:34:09 -07:00
Monty Taylor
069dc48d38 Add parameterization changes from wikipedia. 2012-07-30 09:31:48 -05:00
Dan Bode
8b2b29a136 Add enabled parameter to mysql::server
This parameter can be used to specify whether the service
should be running.

It has been implemented to allow installations of mysql::server to
be in passive mode for HA.
2012-06-18 14:09:42 -07:00
William Van Hevelingen
05d7e23fe8 (#14330) Add support for FreeBSD
Note: ssl_ca, ssl_cert, and ssl_key do not have sane
defaults in FreeBSD. Setting ssl to true will require
setting the parameters mentioned above.
2012-05-30 19:12:25 -07:00
John Chilton
0f0928ae88 Allow specification of storage engine. 2012-05-15 12:37:03 -05:00
Dan Bode
360f8d968a Merge pull request #64 from runningman/backup
Added mysql::backup class.
2012-05-10 22:44:52 -07:00
Dan Bode
ed62777045 Merge pull request #63 from runningman/security
Added mysql::server::account_security class.
2012-05-04 18:04:11 -07:00
Michael Arnold
8dc651c0e2 Simplify Exec["${name}-import"]
Show that mysql:db can also import SQL from a file in order to, for
example, initialize a database schema.  Since it requires class
mysql::server, we assume to run all commands as the root mysql user
against the local mysql server.
2012-05-03 23:35:51 -07:00
Michael Arnold
70d14e84d7 Update privilege names to comply with 3fbb54de6c. 2012-05-03 19:54:32 -07:00
Branan Purvine-Riley
d0a5b1c534 remove $safe_grant
Now that the ruby can query permissions sanely, filtering 'all' is
no longer necessary
2012-05-01 17:01:06 -07:00
Michael Arnold
fbee243ff6 Rip out backup class parameter defaults.
No need for setting default values to class parameters and then testing
to confirm they are set to non-default values.  Simply do not give them
values to begin with.
2012-04-30 08:07:46 -07:00
Michael Stahnke
e6b45ebfae Merge pull request #60 from geogdog/patch-1
I noticed the following message whilst provisioning using this module:
2012-04-29 15:24:33 -07:00
Michael Stahnke
f750b39ad5 Merge pull request #61 from runningman/java
Java
2012-04-29 15:24:11 -07:00
François Charlier
64f367fbb4 Fix typos in mysql::server::monitor class
* fix the dependency declaration

+ add basic tests
2012-04-24 11:56:01 +02:00
Michael Arnold
7890f79547 Added mysql::server::account_security class.
Secures the MySQL installation by removing the test database and the
default users that are created during the MySQL first-run
(root@${fqdn}, @%, @localhost, etc.).
Includes rspec tests and updated documentation.
2012-04-23 23:41:12 -07:00
Michael Arnold
4158137278 Added mysql::backup class.
Installs a mysql backup script, cronjob, and priviledged backup user. 
Includes rspec tests and updated documentation.
2012-04-23 22:53:59 -07:00
Michael Arnold
0743faa6db Added tests to mysql::java. 2012-04-23 21:44:31 -07:00
Michael Arnold
ba4df4dead Added mysql::java class.
Added a small class to install the Java MySQL connector.
2012-04-23 21:24:01 -07:00
Greg Trahair
097879bad3 I noticed the following message whilst provisioning using this module:
notice: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/returns: mysqladmin: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)

Even though it's not fatal, it's cleaner for Exec['set_mysql_rootpw'] to require File['/etc/mysql/conf.d'].
2012-04-23 13:06:39 +03:00
Derek Higgins
9ff99ba336 set platform dependent error logfile location 2012-04-12 00:06:35 +00:00
William Van Hevelingen
f7e0ea5893 (#13203) Add ssl support
This commit adds a ssl parameter to the mysql::config class.
Setting ssl to true adds the following parameters to the template.

   ssl_ca             - path to ssl-ca
   ssl_cert           - path to ssl-cert
   ssl_key            - path to ssl-key
2012-03-21 14:48:22 -07:00
Dan Bode
ce606a9525 Merge pull request #53 from nanliu/tb/travis
Add travis.ci to module
2012-03-20 17:31:45 -07:00
Nan Liu
9ebbbc434d Fix Puppet 2.6 compilation issues.
In Puppet 2.6, negate boolean wasn't handled in resources attribues.
Also hashes values were not accepted in functions. The manifests have
been updated to resolve compilation issues in Puppet 2.6.
2012-03-18 01:56:13 -05:00
William Van Hevelingen
f353fc6a2d (#13163) Datadir should be configurable
Previously datadir was hardcoded to /var/lib/mysql.
This commit makes datadir configurable for MySQL
installations with custom datadir paths.
2012-03-17 20:19:55 -07:00
Nan Liu
72da2c5838 Fix mysql service on Ubuntu.
On Ubuntu, mysql should use upstart provider instead of init.d. This
change overrides the init provider until the issue with init provider
can be addressed.
2012-03-16 18:15:12 -05:00
Nan Liu
812ba01509 Merge pull request #46 from bodepd/add_rspec_tests_for_config_class
Add rspec tests for config class
2012-03-16 11:25:28 -07:00
François Charlier
b14c7d14d2 Add a test to check path for 'mysqld-restart'
And fix a coma error in mysql::config class.

Signed-off-by: François Charlier <fcharlier@ploup.net>
2012-03-16 18:13:16 +01:00
François Charlier
1a9ae6bddf Fix path for 'mysqld-restart'
And log output on failure.

Signed-off-by: François Charlier <fcharlier@ploup.net>
2012-03-16 15:31:42 +01:00
Dan Bode
da62ad66f0 Moved class dependency between sever and config to server
Prevously, the server class declared the config class and
the config class had a relationship to the server class.

This actually meant that the config class could never be declared
by itself b/c it exlicity depended on the server class (which it
could never resolve externally b/c it would result in a redeclaration
of the config class itself.)

This issue actually made it impossible to test the manifest on its
own with rspec-puppet. This commit makes it much easier to write
rspec tests for the config class.
2012-03-15 00:51:35 -07:00
Dan Bode
0832a2c1d2 Notify mysql restart from set_mysql_rootpw exec
Since the set_mysql_rootpw exec is only created
when the password is being managed, having the mysql
resource (which always exists) reference it leads
to an error when the mysql root password is not being
managed.

This commit resolves the issue by having the set
mysql rootpw exec notify the mysql restart if it
changes.
2012-03-14 23:12:12 -07:00
Dan Bode
e472d3b48d Mention osfamily value in failure message
This commit displays the detected osfamily that
is not supported by this module.

It was previously unclear to users seeing the failure
what the value of osfamily was that was causing the
failure.
2012-03-14 23:07:02 -07:00
Nan Liu
b1f90fd1d2 Major refactor of mysql module.
This is a major change to the module and would be released as a new
version.

* Add self.instances to database and database_user for puppet resource.
* Update database provider to use flush method.
* Update module to conform to puppet-lint recommendations.
* Cleanup some unecessary logic in mysql::db define type.
* Move mysql_restart to config class.
* Use class to class dependency instead of resource dependency.
* Change appropriate rspec-puppet tests.
* Add fixtures directory to simplify testing.
* Update raketask and spec_helper to reflect fixture changes.
* Update mysql_password function to support validation.
* Move client installation to a separate class.
* Update documentation and readme.
2012-03-13 15:19:53 -07:00
Justin Ellison
1e926b4516 Ruby and Python's MySQL libraries are named differently on different
distros.
2012-02-28 10:34:19 -08:00
Justin Ellison
09af083e3c Per @ghoneycutt, we should fail explicitly and explain why. 2012-02-28 10:34:19 -08:00
Justin Ellison
7513d0308c Removing duplicate declaration 2012-02-28 10:34:19 -08:00
Justin Ellison
031a47dfad Instead of hardcoding the config file target, pull it from mysql::params 2012-02-28 10:34:19 -08:00
Justin Ellison
360eacd4e0 Moved $socket to within the case to toggle between distros. Added
a $config_file variable to allow per-distro config file destinations.
2012-02-28 10:34:19 -08:00
Justin Ellison
3462e6bf13 Pretty sure this is a bug, 99% of Linux distros out there won't
ever hit the default.

Moving the variables to just after the case statement will set
them, removing the default part of the case will cause this class
to fail on unsupported distros.
2012-02-28 10:34:19 -08:00
Carl Caum
0783c748b7 Only notify Exec to import sql if sql is given
Commit e3b9fd broke the mysql::db defined type by always notifying the
Exec[${name}-import-import] resource even though the resource may not be
declared if the $sql parameter was not given. This commit adds an
in-selector to only notify the Exec resource if the $sql parameter has a
value.  More extensive rspec-puppet tests have been provided to protect
against this in the future.
2011-12-19 20:48:47 -08:00
Carl Caum
e3b9fd90a6 (#11508) Only load sql_scripts on DB creation
Previous to this commit, if the sql parameter was provided to a
declaration of the mysql::db defined type, the defined type would always
load the sql script on every catalog run. This changes the exec that
loads that sql script to be refreshonly unless the enforce_sql parameter
is set to true.
2011-12-19 07:25:35 -08:00
Justin Ellison
3058feb1f3 Require not needed due to implicit dependencies 2011-12-13 18:57:38 -06:00
Justin Ellison
a557b8d7c8 Bug #11375: puppetlabs-mysql fails on CentOS/RHEL 2011-12-13 17:36:56 -06:00
Christian G. Warden
92660497a2 (#11185) Fully qualify $operatingsystem
Fully qualify $operatingsystem from root scope as $::operatingsystem. This
should help remove the warnings in Puppet 2.7.x.
2011-12-05 23:34:53 +00:00
Ken Barber
68e4c6af32 Merge pull request #21 from bodepd/config_hash_update
(#10391) Update docs to reflect config_hash.
2011-10-31 11:06:00 -07:00
Dan Bode
e1cb227803 (#10391) Update docs to reflect config_hash.
Configuration was moved to config hash param of the mysql::server class.

This was done so that additional parameters can be
added in the future and not have to be added to
both mysql::config and mysql::server as class params

This patch updates the README, docs, and examples to
correctly use the parameter.
2011-10-31 11:01:57 -07:00
Dan Bode
319644cec5 (#10390) Manage /etc/mysql directory.
/etc/mysql/my.cnf was being managed and /etc/mysql was not.
This was causing failures if the directory was not created
by the package.

This commit manages it in case it was not created by the package.
2011-10-31 10:39:08 -07:00
Dan Bode
eb608164e4 Fixed dep issue.
the exec was set to depend on a conditional resource
resulting in possible errors. Reversed the conditional
to be set on the conditonal resource.
2011-06-24 10:28:55 -07:00