puppet_mysql.git
4 years agoMerge branch 'non_ascii_comment' into 'master' master
Jerome Charaoui [Wed, 7 Oct 2015 15:46:27 +0000 (15:46 +0000)]
Merge branch 'non_ascii_comment' into 'master'

remove non-ascii char in comment in init.pp

Apparently puppet doesn't like ppl who don't speak English and crashes
on non-ASCII chars in comments.

Assigned to Jerome for review (but the pick was somewhat random)

See merge request !4

4 years agoremove non-ascii char in comment in init.pp
Gabriel Filion [Sat, 26 Sep 2015 21:58:23 +0000 (17:58 -0400)]
remove non-ascii char in comment in init.pp

Apparently puppet doesn't like ppl who don't speak English and crashes
on non-ASCII chars in comments.

4 years agopackage containing ruby bindings is renamed 'ruby-mysql' in wheezy and later releases
Jerome Charaoui [Wed, 5 Aug 2015 14:22:04 +0000 (10:22 -0400)]
package containing ruby bindings is renamed 'ruby-mysql' in wheezy and later releases

4 years agoaccount_security doesn't exist anymore
Gabriel Filion [Wed, 13 May 2015 20:05:42 +0000 (16:05 -0400)]
account_security doesn't exist anymore

4 years agomysql_ibdata1 is not managed anymore but is still overridden for debian
Gabriel Filion [Wed, 13 May 2015 20:03:47 +0000 (16:03 -0400)]
mysql_ibdata1 is not managed anymore but is still overridden for debian

4 years agomysql root password is leaked to the process list
Gabriel Filion [Wed, 13 May 2015 20:02:36 +0000 (16:02 -0400)]
mysql root password is leaked to the process list

Every time the root password reset is used we're leaking the password to
the process list. If we use the already present /root/.my.cnf for
credentials then it has the same effect for verification and we avoid
leaking the password.

4 years agoMerge branch 'master' into merge_immerda_new
Jerome Charaoui [Tue, 21 Apr 2015 13:44:01 +0000 (09:44 -0400)]
Merge branch 'master' into merge_immerda_new

Conflicts:
manifests/server/cron/backup.pp

4 years agoRestore a few things that got removed:
Jerome Charaoui [Fri, 17 Apr 2015 21:18:25 +0000 (17:18 -0400)]
Restore a few things that got removed:
* Manage /etc/mysql/mysql.conf.d
* Account security ensures
* Check mysql_exists before realizing ressources

These last two points partially revert commit
e1649647f326abeb256a73e4cb1060840f846f24

4 years agoRestore parameters from optimize cronjob class
Jerome Charaoui [Fri, 17 Apr 2015 15:59:40 +0000 (11:59 -0400)]
Restore parameters from optimize cronjob class

4 years agoAdd GPLv3 license
Micah Anderson [Fri, 17 Apr 2015 15:27:57 +0000 (11:27 -0400)]
Add GPLv3 license

4 years agoCron jobs are not removed when unused.
Gabriel Filion [Sun, 6 Apr 2014 21:07:47 +0000 (17:07 -0400)]
Cron jobs are not removed when unused.

Currently, if you have the bad idea of setting backup_cron or
optimize_cron to true in the main class and later to change it back to
false, the associated cronjob will stay in place even though you don't
want it.

To make this option more consistant, let's remove cron jobs (and backup
helper scripts) when the appropriate option is set to false.

Signed-off-by: Gabriel Filion <gabster@lelutin.ca>
4 years agoMerge branch 'master' of git://git.puppet.immerda.ch/module-mysql
Jerome Charaoui [Tue, 24 Feb 2015 21:46:45 +0000 (16:46 -0500)]
Merge branch 'master' of git://git.puppet.immerda.ch/module-mysql

Conflicts:
files/scripts/optimize_tables.rb
manifests/server/base.pp

4 years agoMerge branch 'document_nagios_custom_logic' into 'master'
Jerome Charaoui [Fri, 20 Feb 2015 22:40:18 +0000 (22:40 +0000)]
Merge branch 'document_nagios_custom_logic' into 'master'

Document nagios custom logic

Add some note for ppl who need to inject their own logic before creating nagios-related checks.

See merge request !1

4 years agoREADME: mention why using manage_nagios can be used for inserting logic
Gabriel Filion [Fri, 20 Feb 2015 21:24:45 +0000 (16:24 -0500)]
README: mention why using manage_nagios can be used for inserting logic

If you need to avoid creating certain nagios checks for some reason
that's specific to your local policies, you can avoid letting the module
from automatically managing nagios services and then include it whenever
you need it.

4 years agoREADME: fix variable name for nagios
Gabriel Filion [Fri, 20 Feb 2015 21:14:43 +0000 (16:14 -0500)]
README: fix variable name for nagios

Documentation mentions something but the manifests use another name for
the variable.

4 years agowe only need to ensure grants if the user is present
mh [Sun, 25 Jan 2015 12:48:52 +0000 (13:48 +0100)]
we only need to ensure grants if the user is present

4 years agofix issues for EL7 + simplify account security
mh [Sat, 24 Jan 2015 17:05:08 +0000 (18:05 +0100)]
fix issues for EL7 + simplify account security

* EL7 uses mariadb & systemd -> adjust setpasswd script to that
* move the security ensurance to the setpassword script, as it's
  easier to ensure that there

4 years agosplit on new line, which fixes an issue if no table is found
mh [Mon, 12 Jan 2015 22:29:41 +0000 (23:29 +0100)]
split on new line, which fixes an issue if no table is found

4 years agothis should be variables
mh [Sat, 10 Jan 2015 10:42:33 +0000 (11:42 +0100)]
this should be variables

4 years agointroduce new mariadb based config for EL7
mh [Sat, 10 Jan 2015 01:18:15 +0000 (02:18 +0100)]
introduce new mariadb based config for EL7

4 years agoThere is no need to call “super” here.
mh [Sat, 10 Jan 2015 01:04:55 +0000 (02:04 +0100)]
There is no need to call “super” here.

This patch avoid the following error:
  Validate method failed for class sleep: implicit argument passing
  of super from method defined by define_method() is not supported.
  Specify all arguments explicitly.

See https://git.openstack.org/cgit/stackforge/puppet-vswitch/commit/?id=25afbfe58867fb39266a8862cfd6a3f8f38a9564

4 years agoon EL7 there is now mariadb
mh [Sat, 10 Jan 2015 00:50:39 +0000 (01:50 +0100)]
on EL7 there is now mariadb

5 years agoMerge branch 'mention_path'
Gabriel Filion [Wed, 12 Mar 2014 20:26:42 +0000 (16:26 -0400)]
Merge branch 'mention_path'

5 years agoMerge branch 'conf_define'
Gabriel Filion [Wed, 12 Mar 2014 20:26:32 +0000 (16:26 -0400)]
Merge branch 'conf_define'

5 years agoDocument the new define in the README
Gabriel Filion [Wed, 12 Mar 2014 20:25:58 +0000 (16:25 -0400)]
Document the new define in the README

Signed-off-by: Gabriel Filion <gabster@lelutin.ca>
5 years agoMerge branch 'randomize_optimize'
Gabriel Filion [Wed, 12 Mar 2014 15:43:31 +0000 (11:43 -0400)]
Merge branch 'randomize_optimize'

5 years agoFix command output capturing in optimize_tables.rb for Ruby 1.9
Jerome Charaoui [Tue, 11 Mar 2014 21:57:03 +0000 (17:57 -0400)]
Fix command output capturing in optimize_tables.rb for Ruby 1.9

5 years agoFix munin plugin class on Debian
Jerome Charaoui [Tue, 11 Mar 2014 18:52:56 +0000 (14:52 -0400)]
Fix munin plugin class on Debian

5 years agodocument the new arguments for setting optimize run time
Gabriel Filion [Thu, 6 Mar 2014 23:52:57 +0000 (18:52 -0500)]
document the new arguments for setting optimize run time

5 years agoRandomize time of execution for optimize script.
Gabriel Filion [Thu, 6 Mar 2014 23:38:20 +0000 (18:38 -0500)]
Randomize time of execution for optimize script.

By default, time will be between midnight and 7:00 any day of the week.

The values are currently hard-coded. This can have serious I/O
repercussions on a server with multiple VMs that run mysql since they
will all run their optimizations simultaneously.

5 years agoadd mysqltuner class
mh [Fri, 28 Feb 2014 13:50:17 +0000 (14:50 +0100)]
add mysqltuner class

5 years agofix #6638 - remove the unless check & improve script
mh [Wed, 5 Feb 2014 21:34:17 +0000 (22:34 +0100)]
fix #6638 - remove the unless check & improve script

To workaround a limitation of the exec provider within puppet, we
do the unless check no within the script itself and ensure that
we use the password there.

https://labs.riseup.net/code/issues/6638

5 years agoimprove optimize script
mh [Sun, 12 Jan 2014 13:19:26 +0000 (14:19 +0100)]
improve optimize script

5 years agoconf: notify mysql service to make changes effective
Gabriel Filion [Wed, 18 Dec 2013 20:15:37 +0000 (15:15 -0500)]
conf: notify mysql service to make changes effective

5 years agomanage configuration snippets in a conf.d directory
Gabriel Filion [Thu, 5 Dec 2013 21:19:52 +0000 (16:19 -0500)]
manage configuration snippets in a conf.d directory

this should make it easier to override values from my.cnf, or to set
other values that aren't in the main config file.

5 years agoupdate README to document the stdlib dependency
mh [Thu, 5 Dec 2013 19:18:27 +0000 (20:18 +0100)]
update README to document the stdlib dependency

5 years agointroduce the /etc/mysql/conf.d/ directory for CentOS
mh [Thu, 5 Dec 2013 19:14:04 +0000 (20:14 +0100)]
introduce the /etc/mysql/conf.d/ directory for CentOS

5 years agobetter use this built in fact now
mh [Thu, 5 Dec 2013 09:49:54 +0000 (10:49 +0100)]
better use this built in fact now

5 years agosome reasonable defaults
mh [Thu, 5 Dec 2013 09:47:25 +0000 (10:47 +0100)]
some reasonable defaults

5 years agoupdate to latest EL release
mh [Wed, 4 Dec 2013 22:40:38 +0000 (23:40 +0100)]
update to latest EL release

5 years agorename deprecated option
mh [Wed, 4 Dec 2013 22:24:59 +0000 (23:24 +0100)]
rename deprecated option

5 years agoalso chown the data dir
mh [Wed, 4 Dec 2013 22:19:09 +0000 (23:19 +0100)]
also chown the data dir

5 years agothis is not really necessary
mh [Wed, 4 Dec 2013 22:15:26 +0000 (23:15 +0100)]
this is not really necessary

5 years agoEL6.4 doesn't know about bdb
mh [Wed, 4 Dec 2013 22:12:22 +0000 (23:12 +0100)]
EL6.4 doesn't know about bdb

5 years agosetmysqlpass: be more careful before plundering into action
Gabriel Filion [Fri, 15 Nov 2013 08:19:40 +0000 (03:19 -0500)]
setmysqlpass: be more careful before plundering into action

Since this script is rooting the database, it'd be good to use a little
more precaution so that we don't let systems be in an inconsistent case
when crashing.

In cases where the PATH variable is not appropriately set (variable is
empty by default when script is invoked by puppet) the script shuts down
mysql and then is not able to call most commands.

5 years agoREADME: Mention the need for setting the path appropriately
Gabriel Filion [Fri, 15 Nov 2013 06:12:00 +0000 (01:12 -0500)]
README: Mention the need for setting the path appropriately

Without at least /sbin, /bin, /usr/sbin and /usr/bin, the
setmysqlpass.sh script won't run correctly and the module will not set
the requested root password.

6 years agofix ordering
mh [Mon, 20 May 2013 12:36:59 +0000 (14:36 +0200)]
fix ordering

6 years agouse the defaults file if available
mh [Mon, 20 May 2013 12:32:43 +0000 (14:32 +0200)]
use the defaults file if available

6 years agosymbolize was removed in puppet 3 - See http://projects.puppetlabs.com/issues/16791
mh [Mon, 20 May 2013 12:05:00 +0000 (14:05 +0200)]
symbolize was removed in puppet 3 - See projects.puppetlabs.com/issues/16791

6 years agosome mysql versions start to display a nasty warning - http://bugs.mysql.com/bug...
mh [Fri, 3 May 2013 09:38:14 +0000 (11:38 +0200)]
some mysql versions start to display a nasty warning - bugs.mysql.com/bug.php?id=68376

6 years agointroduce helpers for mysql backups
mh [Mon, 18 Feb 2013 21:13:56 +0000 (22:13 +0100)]
introduce helpers for mysql backups

6 years agoToo much linting for facts
Gabriel Filion [Mon, 18 Feb 2013 21:16:35 +0000 (16:16 -0500)]
Too much linting for facts

ng brought a problem with my latest linting commit:

facts are _always_ strings, so unquoting the value that we're testing
against is actually wrong, even though puppet-lint complains.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
6 years agolint mysql::server
Gabriel Filion [Wed, 16 Jan 2013 02:30:44 +0000 (03:30 +0100)]
lint mysql::server

6 years agofix typo
mh [Wed, 2 Jan 2013 17:54:51 +0000 (18:54 +0100)]
fix typo

6 years agomake trocla an optional dependency
mh [Wed, 2 Jan 2013 17:48:49 +0000 (18:48 +0100)]
make trocla an optional dependency

6 years agomysql 5.0 does not yet know about :trigger_priv
mh [Wed, 2 Jan 2013 17:19:06 +0000 (18:19 +0100)]
mysql 5.0 does not yet know about :trigger_priv

6 years agoget rid off trailing ,
mh [Wed, 2 Jan 2013 17:18:39 +0000 (18:18 +0100)]
get rid off trailing ,

6 years agoMerge remote-tracking branch 'riseup/master'
mh [Wed, 2 Jan 2013 16:25:51 +0000 (17:25 +0100)]
Merge remote-tracking branch 'riseup/master'

Conflicts:
manifests/client.pp
manifests/server.pp
manifests/server/base.pp
manifests/server/cron/backup.pp
manifests/server/munin/default.pp
manifests/server/nagios.pp

6 years agolinting
mh [Wed, 2 Jan 2013 16:13:45 +0000 (17:13 +0100)]
linting

6 years agoMerge remote-tracking branch 'shared/master'
mh [Wed, 2 Jan 2013 16:03:18 +0000 (17:03 +0100)]
Merge remote-tracking branch 'shared/master'

Conflicts:
files/config/my.cnf.Debian
manifests/server/base.pp
manifests/server/munin/default.pp
manifests/server/nagios.pp

6 years agosome need the password not quoted...
mh [Mon, 10 Dec 2012 10:01:28 +0000 (11:01 +0100)]
some need the password not quoted...

6 years agosimplify and correct dependencies
mh [Sun, 9 Dec 2012 15:03:39 +0000 (16:03 +0100)]
simplify and correct dependencies

1. it is important that the root password works
2. we don't need to chain the dependencies

6 years agodocument intend of refreshonyl for setting root pw
mh [Sun, 9 Dec 2012 15:01:02 +0000 (16:01 +0100)]
document intend of refreshonyl for setting root pw

6 years agofix dependency issues
mh [Sun, 9 Dec 2012 14:52:34 +0000 (15:52 +0100)]
fix dependency issues

6 years agoworaround a puppet provider bug
mh [Sun, 9 Dec 2012 14:12:19 +0000 (15:12 +0100)]
woraround a puppet provider bug

6 years agolinting
mh [Thu, 6 Dec 2012 22:09:44 +0000 (23:09 +0100)]
linting

7 years ago2.7 underscore rename: site-mysql
Micah Anderson [Wed, 27 Jun 2012 19:47:24 +0000 (15:47 -0400)]
2.7 underscore rename: site-mysql

7 years agofix typo
mh [Sun, 17 Jun 2012 19:44:56 +0000 (16:44 -0300)]
fix typo

7 years agotake hiera out of the params
mh [Thu, 14 Jun 2012 18:02:17 +0000 (15:02 -0300)]
take hiera out of the params

7 years agotake hiera out of the params
mh [Thu, 14 Jun 2012 17:53:44 +0000 (14:53 -0300)]
take hiera out of the params

7 years agosome more hiera variables removed
o [Thu, 14 Jun 2012 14:33:31 +0000 (11:33 -0300)]
some more hiera variables removed

7 years agoremove hiera
o [Wed, 13 Jun 2012 23:22:45 +0000 (20:22 -0300)]
remove hiera

7 years agorefactor things for >2.7
mh [Fri, 8 Jun 2012 16:04:06 +0000 (13:04 -0300)]
refactor things for >2.7

7 years agouse correct backup location
mh [Mon, 14 May 2012 08:29:37 +0000 (10:29 +0200)]
use correct backup location

Up to now we used an empty backup location... :/

7 years agoMerge remote-tracking branch 'laurantb/master'
mh [Sun, 29 Apr 2012 10:55:07 +0000 (12:55 +0200)]
Merge remote-tracking branch 'laurantb/master'

Conflicts:
manifests/server/cron/backup.pp

7 years agofix trocla function lookup in template, without this, you get:
Micah Anderson [Wed, 18 Apr 2012 17:26:57 +0000 (13:26 -0400)]
fix trocla function lookup in template, without this, you get:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template mysql/root/my.cnf.erb: undefined method `function_trocla' for #<Puppet::Parser::Scope:0xf6457e2c> at /etc/puppet/modules/mysql/manifests/server/base.pp:50 on node

7 years agofix another trivial syntax error
Micah Anderson [Wed, 18 Apr 2012 15:36:09 +0000 (11:36 -0400)]
fix another trivial syntax error

7 years agofix syntax error
Micah Anderson [Wed, 18 Apr 2012 15:30:36 +0000 (11:30 -0400)]
fix syntax error

7 years agoMerge remote-tracking branch 'lelutin/nagios_service' into shared
Micah Anderson [Wed, 11 Apr 2012 22:28:15 +0000 (18:28 -0400)]
Merge remote-tracking branch 'lelutin/nagios_service' into shared

7 years agoMerge remote-tracking branch 'lelutin/squeeze_my_cnf' into shared
Micah Anderson [Wed, 11 Apr 2012 22:25:17 +0000 (18:25 -0400)]
Merge remote-tracking branch 'lelutin/squeeze_my_cnf' into shared

7 years agofix $use_munin hiera check to be use_munin instead of incorrect use_nagios
Micah Anderson [Wed, 11 Apr 2012 16:59:33 +0000 (12:59 -0400)]
fix $use_munin hiera check to be use_munin instead of incorrect use_nagios
add $use_nagios hiera check

7 years agoImport my.cnf from Debian Squeeze
Gabriel Filion [Mon, 9 Apr 2012 06:26:23 +0000 (02:26 -0400)]
Import my.cnf from Debian Squeeze

Lenny support was phased out and squeeze is the current stable.

There is an instruction in the file that originally came from lenny:
skip-bdb doesn't exist anymore in the mysql version in squeeze, so the
config file makes a fresh mysql install crash on Squeeze.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
7 years agoswitch hiera to pull its variables in parameterized classes instead of inline in...
Micah Anderson [Wed, 4 Apr 2012 21:47:13 +0000 (17:47 -0400)]
switch hiera to pull its variables in parameterized classes instead of inline in the manifest

7 years agoadd note to README about mysql::server::account_security removing accounts by default...
Micah Anderson [Wed, 4 Apr 2012 17:42:11 +0000 (13:42 -0400)]
add note to README about mysql::server::account_security removing accounts by default, and how to get around it

7 years agoMerge remote-tracking branch 'immerda/master'
Micah Anderson [Wed, 4 Apr 2012 16:22:09 +0000 (12:22 -0400)]
Merge remote-tracking branch 'immerda/master'

Conflicts:
manifests/server/munin/default.pp
manifests/server/nagios.pp

7 years agoMerge branch 'shared'
Micah Anderson [Wed, 7 Mar 2012 20:11:06 +0000 (15:11 -0500)]
Merge branch 'shared'

7 years agofix typo in name of mysql_qcache_mem graph
Micah Anderson [Wed, 7 Mar 2012 20:10:48 +0000 (15:10 -0500)]
fix typo in name of mysql_qcache_mem graph

7 years agoMerge branch 'shared'
Micah Anderson [Wed, 7 Mar 2012 16:52:15 +0000 (11:52 -0500)]
Merge branch 'shared'

7 years agoMerge commit '356fdab8147f8a32a3f14514f2bb77f4f312c734' into shared
Micah Anderson [Wed, 7 Mar 2012 16:49:28 +0000 (11:49 -0500)]
Merge commit '356fdab8147f8a32a3f14514f2bb77f4f312c734' into shared

Conflicts:
files/munin/mysql_connections
manifests/server/base.pp
manifests/server/munin/default.pp

7 years agoMerge branch 'shared'
Micah Anderson [Wed, 7 Mar 2012 16:05:49 +0000 (11:05 -0500)]
Merge branch 'shared'

7 years agoMerge remote-tracking branch 'lelutin/root_pw_no_arg' into shared
Micah Anderson [Wed, 7 Mar 2012 16:02:01 +0000 (11:02 -0500)]
Merge remote-tracking branch 'lelutin/root_pw_no_arg' into shared

Conflicts:
manifests/server/base.pp

7 years agoMerge remote-tracking branch 'lelutin/nagios_service'
Micah Anderson [Thu, 1 Mar 2012 04:50:22 +0000 (23:50 -0500)]
Merge remote-tracking branch 'lelutin/nagios_service'

7 years agoUse the right parameter to nagios::service::mysql
Gabriel Filion [Thu, 23 Feb 2012 09:52:55 +0000 (04:52 -0500)]
Use the right parameter to nagios::service::mysql

check_hostname is not defined. We need to use check_host instead

7 years agocorrect key for trocla lookup
mh [Fri, 10 Feb 2012 14:04:40 +0000 (15:04 +0100)]
correct key for trocla lookup

7 years agomigrate everything to hiera/trocla and use the new scoping style
mh [Fri, 10 Feb 2012 13:35:19 +0000 (14:35 +0100)]
migrate everything to hiera/trocla and use the new scoping style

7 years agoadd the trigger privilege to the list of potential MYSQL_USER_PRIVS
Micah Anderson [Mon, 23 Jan 2012 04:48:33 +0000 (23:48 -0500)]
add the trigger privilege to the list of potential MYSQL_USER_PRIVS

7 years agoadd innodb_file_per_table option by default
mh [Tue, 17 Jan 2012 21:31:44 +0000 (22:31 +0100)]
add innodb_file_per_table option by default

mysql has one innodb file per default and this can become very
huge, which can trigger various issues [1]. So in general it
is recommended to set the innodb_file_per_table option [2].

[1] http://forums.mysql.com/read.php?35,121880,121886
[2] http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html

7 years agofix missing end
Micah Anderson [Mon, 16 Jan 2012 20:48:31 +0000 (15:48 -0500)]
fix missing end

7 years agoInstead of doing an update table_priv, we need to do GRANT/REVOKE statements
Micah Anderson [Sun, 1 Jan 2012 20:43:47 +0000 (15:43 -0500)]
Instead of doing an update table_priv, we need to do GRANT/REVOKE statements

When we are working with tables_priv we need to first get a downcased array of the currently set privileges, and a downcased array of the desired permissions.

Then we make a list of the permissions to revoke by subtracting the requested permissions from the currently set ones.

If the list of permissions to revoke is not empty, then we issue a REVOKE.

Then we make a list of the permissions to add by subtracting the requested permissions from the current set (no need to add select again if it is already there).

Then if the set of permissions to add is not empty, then we actually execute the statement.

7 years agotable privileges need to be handled with GRANT/REVOKE statements instead of inserts...
Micah Anderson [Sun, 1 Jan 2012 20:35:44 +0000 (15:35 -0500)]
table privileges need to be handled with GRANT/REVOKE statements instead of inserts of Y/N values into the table.

To handle this, this comment removes the create_row for table_privs, it also selects the actual value of the Table_priv so its value can be used instead of the method that is used for Y/N value settings