Commit graph

289 commits

Author SHA1 Message Date
Martin Hagstrom
61058b7610 Don't hash passwords that are already hashed 2015-11-19 07:54:10 +01:00
Artur Gadelshin
27323f74e6 (MODULES-2767) fix mysql_table_exists: add check for args.size, fix rspec test 2015-11-09 16:04:38 +03:00
Artur Gadelshin
e518abd97e (MODULES-2767) allow to check if table exists before grant 2015-11-07 19:23:20 +03:00
JT (Jonny)
b91630d7a3 Merge pull request #767 from jmk61/MODULES-2675
Fixes unique server_id within my.cnf Ticket/MODULES-2675
2015-10-27 14:52:34 +00:00
David Schmitt
5f49c45b2e (MODULES-2683) fix version compare to properly suppress show_diff for root password 2015-10-13 11:29:53 +01:00
David Schmitt
6527a3aa22 (MAINT) switch to rspec-puppet-facts
Switching out the puppet version, as puppet_facts does, does not work,
as this will confuse code that wants to use version-dependent features.

Instead this uses rspec-puppet-facts, which doesn't touch the puppet
version.
2015-10-13 11:29:42 +01:00
Joseph Karns
96c9d6d9a7 Fixes unique server_id within my.cnf, The issue was that the entire mac address was not being read in to generate the id. 2015-10-12 12:36:39 -04:00
Roman Mueller
afddc3ff7b Fix fetching the mysql_user password for MySQL >=5.7.6
The password column has been renamed to authentication_string in MySQL >=5.7.6.
By using: SELECT /*!50706 AUTHENTICATION_STRING AS */ PASSWORD the query will
continue to work in older versions as well as newer ones.
2015-09-30 18:55:26 +02:00
Morgan Haskel
97b8200a5f Improved user validation and munging
We want to make sure we are validating the entire user parameter (and
validating it consistently between mysql_user and mysql_grant).
Additionally, for munging we do not want to do anything that could
truncate the username.
2015-09-24 11:35:14 -07:00
Mickaël Canévet
6228846ae0 Fix when not managing config file
This code have been remove here 4bab65edcb (diff-0938042fe2382aeb10032aa7f8444995) but it is required otherwise we get an `Evaluation Error: Unknown variable: 'install_db_args'.` when using `manage_config_file = false`
2015-09-22 14:28:15 +02:00
JT (Jonny)
ced1a08c34 Merge pull request #682 from eems-leo/process-secret-file
Remove default install root password if set
2015-08-06 15:14:19 +01:00
Johnson Earls
6924dea7bd #2030 Only establish dependency between service and package if package is managed. 2015-08-06 14:23:47 +01:00
JT (Jonny)
2c8a822f25 Merge pull request #744 from danzilio/xtrabackup_enhancements
(MODULES-2340) Implement script functionality for xtrabackup provider
2015-08-06 13:57:02 +01:00
David Danzilio
a7a5c66bc4 Add support for postscript for xtrabackup provider
This commit implements the 'postscript' functionality for the xtrabackup
provider. It also adds a 'prescript' option to be executed before a
backup.
2015-08-05 16:15:25 -04:00
Hunter Haugen
c7de52013b Merge pull request #742 from redhat-cip/idempotent-config
Ensure idempotency between Puppet runs
2015-08-04 11:05:46 -07:00
Emilien Macchi
ba52d1d6e9 Ensure idempotency between Puppet runs
Running RHEL 7.1, puppetlabs-mysql is not idempotent.
After a second run, puppet tries to change the SElinux context:
/File[mysql-config-file]/seltype: seltype changed 'etc_t' to
'mysqld_etc_t'

Since packaging already manages SElinux labels, we should not let
Puppet doing it (default behavior).
This patch aims to set selinux_ignore_defaults to True for the
mysql-config-file File resource.

Thanks to that patch, Puppet will be indempotent between all runs on
RHEL platforms.
2015-08-04 13:38:03 -04:00
David Schmitt
502bdc9360 (maint) workaround PUP-3450 on Solaris 11 2015-07-27 14:27:23 +01:00
David Schmitt
253f74925e (maint) fix spec formatting
this configuration caused rspec to output messages twice on travis
2015-07-24 15:14:37 +01:00
Morgan Haskel
c6afa1181a Merge pull request #722 from igalic/lenght_check
length check for usernames should take mysql version into consideration
2015-06-25 11:18:24 -07:00
David Schmitt
097efe2d41 spec_helper_acceptance: Remove conflicting yum install
puppetlabs-release is not required anymore. run_puppet_install_helper
takes care of all that.
2015-06-18 12:13:55 +01:00
Hunter Haugen
53257df16f Add helper to install puppet/pe/puppet-agent 2015-06-11 16:14:06 -07:00
Justin Stoller
5185d3d360 (maint) allow setting PUPPET_VERSION in acceptance 2015-06-08 22:22:26 -07:00
Igor Galić
837c21b963 length check for usernames should take mysql version into consideration
Starting MariaDB 10.0.0, usernames are now 80 long.
Our mysql_user and mysql_grant types now take that into consideration.

This check is *opportunistic*. It will only take place if the
mysql_version fact is available. If that is not the case, it will be
skipped, leaving the database itself to deal with it, and returning its
error verbatim to our users, if it does fail.

Our fixed and extended tests assume this isn't the first run, and the
fact is already in place.
2015-05-29 14:13:39 +02:00
Travis Fields
d3901f205a (fix) - Change default for mysql::server::backup to ignore_triggers => false
- Update spec acceptance test to check for which version is currently installed prior to testing
2015-05-12 09:45:10 -07:00
Travis Fields
9dad94a8c6 (fix) - Fix issue where fact is unknown at start
- Resolve issue where if known and failed versioncmp would result in idempotency issue on second run
2015-05-11 09:36:35 -07:00
Travis Fields
8b1fa24479 (fix) - Fix an issue were we assume triggers work
- There are older versions of mysql that do not support the privilege TRIGGER and need to change default to not include
  http://dev.mysql.com/doc/refman/5.0/en/grant.html
  'MySQL does not support the standard SQL UNDER privilege, and does not support the TRIGGER privilege until MySQL 5.1.6'

- Updated tests to have both 5.1.6 and 5.0.11 tests for mysql_version fact
2015-05-08 08:51:38 -07:00
Travis Fields
3ce8ad3799 (maint) - Add a fact for capturing the mysql version installed
- Add spec test for mysql_version fact
- Add `mysql_version` fact to README
2015-05-08 08:51:38 -07:00
Steven C. Saliman
49f273a42c Made the 'TRIGGER'privilege of mysqldump backups depend on whether or not we are actually backing up triggers 2015-04-30 12:37:38 -06:00
Steven C. Saliman
ec14b87a81 Added options for including/excluding triggers and routines, and fixed a permission problem that was preventing triggers from being backed up 2015-04-30 08:01:06 -06:00
Morgan Haskel
298242e043 MODULES-1928 - allow log-error to be undef
Wrap the file resource so that this doesn't explode if log-error is
undef. This is required for syslogging.
2015-04-13 17:05:22 -07:00
Colleen Murphy
a59c68b165 Update tests for rspec-puppet 2 and future parser
This patch changes the raise_error matchers to use `catalogue` instead
of `subject` since `subject` is not evaluated the way it used to be;
changes a parameter value from empty string to nil to be compatible
with the future parser, and unpins rspec-puppet.
2015-03-23 22:09:15 -07:00
Jesse Cotton
a26b80d750 Remove default install root password if set 2015-03-17 15:21:07 +00:00
tphoney
78a787107f minor typos fixed 2015-03-04 10:56:32 +00:00
Igor Galić
d7077b43d2 document mysql_server_id fact and add spec tests
add spec tests, expand documentation to mention lo behaviour
also, rename fact, for, consistency.
2015-03-04 08:56:45 +01:00
Morgan Haskel
7a3fe1ca00 Merge pull request #617 from juniorsysadmin/package-manage-parameter
(MODULES-1143) Add package_manage parameters
2015-02-27 12:06:25 -08:00
Hunter Haugen
ce43899af3 (MODULES-1804) Allow override of log-error
The mysqld log-error setting may be passed by override_options, but
server/service.pp was not using the overridden value. This fixes that.
2015-02-27 09:54:00 -08:00
David Gurtner
b3c33f0a13 fix bug in GH-578
the recently added feature to support galera by allowing independent
creation of the root@localhost user in the DB and the /root/.my.cnf
file contains a bug.

specifically the .my.cnf file resource still requires the root@localhost
resource, even when it is not available.

this fixes the issue by making the dependency conditional.
2015-02-16 17:01:18 +01:00
juniorsysadmin
f5a693b826 (MODULES-1143) Add package_manage parameter
This patch adds a package_manage parameter for both mysql::server and
mysql::client
2015-02-12 13:33:36 +11:00
Morgan Haskel
b9fbba3b0d Merge pull request #578 from franzs/new_root_options
Add new parameters create_root_user and create_root_my_cnf.
2015-02-09 14:13:07 -08:00
Hunter Haugen
b3a38a8dfe Merge pull request #645 from dveeden/auth-plugins
Support authentication plugins
2015-02-06 12:40:49 -08:00
Hunter Haugen
3fa70506c4 Merge pull request #646 from dveeden/emptypwd
Return an empty string for an empty input.
2015-02-05 10:39:28 -08:00
Daniël van Eeden
279c13b5e3 Return an empty string for an empty input.
https://tickets.puppetlabs.com/browse/MODULES-1676

This is identical to what PASSWORD('') in MySQL does:

5.6.22-debug-log> CREATE USER 'testpwd'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.03 sec)

5.6.22-debug-log> SELECT User,Host,Password FROM mysql.user WHERE
User='testpwd';
+---------+-----------+-------------------------------------------+
| User    | Host      | Password                                  |
+---------+-----------+-------------------------------------------+
| testpwd | localhost | *F3A2A51A9B0F2BE2468926B4132313728C250DBF |
+---------+-----------+-------------------------------------------+
1 row in set (0.01 sec)

5.6.22-debug-log> SET PASSWORD FOR 'testpwd'@'localhost' = PASSWORD('');
Query OK, 0 rows affected (0.00 sec)

5.6.22-debug-log> SELECT User,Host,Password FROM mysql.user WHERE
User='testpwd';
+---------+-----------+----------+
| User    | Host      | Password |
+---------+-----------+----------+
| testpwd | localhost |          |
+---------+-----------+----------+
1 row in set (0.00 sec)
2015-01-28 21:08:29 +01:00
Colleen Murphy
551d22fb84 Fix acceptance tests from #648
Missed Lucid the first time.
2015-01-27 15:05:37 -08:00
Colleen Murphy
80236d1f3a Fix acceptance tests from #641 2015-01-27 13:42:24 -08:00
Daniël van Eeden
74132ec038 Add type & provider for managing plugins 2015-01-26 15:03:45 +01:00
Daniël van Eeden
367fcf06af Support authentication plugins
This uses CREATE USER xxx IDENTIFIED WITH yyy

For tests:
 unix_socket is not loaded by default, so this might require:
 install plugin unix_socket soname 'auth_socket.so';

 The mysql_native_password plugin is available by default and
 allows you to also set a password.

Try to make it compatible with MySQL < 5.5.7 it uses version
specific code with "/*!50508 stmt */"
2015-01-24 17:28:17 +01:00
Colleen Murphy
ccf37e7c8d Revert "Support for authentication plugins" 2015-01-22 11:27:41 -08:00
TP Honey
1a87bae020 Merge pull request #637 from dveeden/account_localhost
Do the right thing when fqdn==localhost
2015-01-22 10:36:01 -08:00
Daniël van Eeden
c04fed1066 When fqdn==localhost account security breaks
This is because the root@localhost account is already
defined.

Remove localdomain accounts if fqdn is localhost
2015-01-18 15:02:17 +01:00
Daniël van Eeden
305b0d2a87 Support authentication plugins
This uses CREATE USER xxx IDENTIFIED WITH yyy

For tests:
 unix_socket is not loaded by default, so this might require:
 install plugin unix_socket soname 'auth_socket.so';

 The mysql_native_password plugin is available by default and
 allows you to also set a password.
2015-01-17 18:41:37 +01:00