Commit graph

20 commits

Author SHA1 Message Date
Hunter Haugen
64d38890c6 Add mysql argument to use mysql database back 2012-10-09 14:02:05 -07:00
Nate Riffe
bdb416053a Use root's credentials when executing mysql.
This is necessary when running puppet as root using sudo because mysql
will still look in the user's home directory in that case unless told
otherwise.
2012-10-09 13:59:58 -07:00
Janos Pasztor
ef3ccd1b8b Added : to allowed host names for IPv6 addresses 2012-09-04 21:44:51 +02:00
Reid Vandewiele
8dac527b2a Add priv validation to database_grant provider
The mysql database_grant provider currently has what is arguably a heinous
design flaw. At present:

 1. The 'privileges' parameter for the database_grant type, mysql provider,
    does not expect the same syntax as the mysql Grant command ('SELECT',
    'UPDATE', 'DELETE', etc). Rather, it expects the user to supply column
    names used to store raw grants in the mysql.db or mysql.user tables
    internally ('Select_priv', 'Update_priv', 'Delete_priv', etc).

 2. If a user supplies `privileges => [ 'SELECT', 'INSERT' ]` instead of
    `privileges => [ 'Select_priv', 'Insert_priv' ]`, the provider fails
    silently and will continuously attempt to update the privileges with
    each successive puppet run. In the specific example provided, all privs
    for the user/db will be set to false since e.g. 'INSERT' does not match
    any valid privilege.

Unfortunately it doesn't look simple to modify the provider such that the
intuitive SELECT, DELETE, etc. keywords can be used without changing
existing behavior. Leaving that alone for now, it *is* pretty simple to add
a validation function that will at least fail cleanly if non-functional
privilege values are supplied that don't mean anything to the provider. If
the user is trying to use valid MySQL Grant syntax, the new validation
procedure will recognize this and suggest a correction. Hopefully giving
users this kind of warning will clue them in to what kind of input the
provider expects.
2012-08-04 10:28:06 -07:00
Branan Purvine-Riley
66c17cd14c Merge pull request #82 from agerlic/escape_database_name
escape database name
2012-07-16 11:19:32 -07:00
Alexandre Gerlic
de0f749ea5 add missing db param to database_grant 2012-06-21 17:27:39 +02:00
Alexandre Gerlic
2817f362d5 escape database name 2012-06-20 23:58:34 +02:00
Rodrigo Menezes
f0f9e76db7 Default types hacks not needed.
Default types hacks not needed.
2012-05-22 16:50:46 -07:00
Dan Bode
05f7807fc0 Merge pull request #71 from runningman/security
Fixed regex of database user.
2012-05-06 23:56:01 -07:00
Michael Arnold
eaf9ee50f6 Fixed regex of database user.
The incorrect regex did not all for the anonymous mysql users to be
removed via the mysql::server::account_security class.  The regex is now
increased to cover for @localhost and @%.
2012-05-06 23:17:49 -07:00
Branan Purvine-Riley
6a81a2f687 (#14316) make privileges case-insensitive 2012-05-04 10:04:46 -07:00
Branan Purvine-Riley
4485dbb95f Remove the global *_PRIVS variables 2012-05-01 17:00:46 -07:00
Dan Bode
015490c787 Fix bug when querying for all database users
This commit fixes an issue in self.instances of
database_user where none of the users were actually
being detected.

There was a accidental '\' in front of the '.' which 
means that it will only consider users that have
one or more '.' in front of the '@'.

This commit removes the '\' so that all users are
returned that have one or more characters in from
of an '@'.
2012-03-14 23:05:20 -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
Matthias Pigulla
d15c9d1621 (#11363) Add two missing privileges to grant: event_priv, trigger_priv
These were missing from the list of allowed privileges:

* event_priv
* trigger_priv

No rspec changes, as we don't even have basic coverage on these providers and
its a minor change so should be low risk.
2011-12-30 16:33:21 +00:00
Christian G. Warden
0292456f76 (#11184) Allow wildcards in account host names
Allow wildcard in the host part of MySQL accounts:

http://dev.mysql.com/doc/refman/5.0/en/grant.html#grant-accounts-passwords

For the examples, Add a database_user test that contains a wildcard in the host
name part.

Also in the examples, pass root_password to mysql::server in config_hash.
2011-12-05 23:39:47 +00:00
Matthias Pigulla
b0ff433860 Fix (#10882) by making all commands optional. 2011-11-16 16:49:31 +01:00
Dan Bode
4774c63435 Database should set charset on create.
Previously, the charset of the database was not
being set on create, causing puppet to have to
potentially run twice to update it.
2011-06-16 21:57:06 -07:00
Dan Bode
f65e49e2ce added more input validation for db user. 2011-05-26 18:10:30 -07:00
Dan Bode
d28f0e0327 adding first commit for mysql. 2011-05-24 23:22:43 -07:00