Commit graph

32 commits

Author SHA1 Message Date
Reinhard Vicinus
9fe85340f4 removed erroneous dependencies 2016-04-08 16:55:57 +02:00
Lars Kellogg-Stedman
23a4a362a0 [#puppethack] use of mysql::db without mysql::server
This removes the hard dependencies on mysql::server from
manifests/db.pp. This permits one to use this module to manage databases
in an existing server, possibly located on a remote host (with a
properly configured /root/.my.cnf).
2015-07-30 15:53:24 +02:00
Sylvain Lamontagne
3b5d5af855 Proper containment for mysql::client in mysql::db 2014-11-18 17:33:18 -05:00
Morgan Haskel
11fb01c736 Fix test issues
Remove the dependency on stdlib 4.x puppetlabs/puppetlabs-mysql#574
introduced, add some input validation, and improve test checks.
2014-11-14 13:16:01 -08:00
Yanis Guenane
5e6a1c418a (MODULES-1338) Allow mysql::db to import several files
A user might need to import several files on database creation.
Currently the module only allows the import of a single file.
This commit allows one to, from now on, import severals.

Before :

  mysql::db { 'test' :
    sql => '/tmp/my_import1.sql',
  }

Now :

  mysql::db { 'test' :
    sql => [
      '/tmp/my_import1.sql',
      '/tmp/my_import2.sql',
    ]
  }
2014-11-13 14:17:50 -05:00
Igor Galić
39aa5f511a Merge pull request #576 from igalic/timeout
Timeout
2014-10-19 19:17:52 +02:00
Colleen Murphy
bf2c8d4bc0 Change sql param to default to undef instead of empty string
The future parser treats the empty string '' as a truthy value. This
means that mysql::db will always try to include the db import exec in
the catalog. With the empty string as the $sql value, the command
attempts to import '' into a database, which fails. This patch changes
the default $sql value to undef so that the exec won't be included if
there is no sql to import.
2014-10-03 11:56:18 -07:00
refnode
4e1bb8f1ce Add timeout parameter to increase for long time running sql imports
Signed-off-by: refnode <refnode@gmail.com>
2014-09-29 17:42:30 +02: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
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
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
Hunter Haugen
82c4b81ba3 Add environment variable for .my.cnf and specs 2013-08-13 13:08:39 -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
Wolf Noble
33e2a45000 Some minor fixes to appease puppet lint 2013-04-11 12:02:41 -05:00
Dominic Cleal
3d1703fc7f Move hash outside of function call, fixes for Puppet 2.6 2013-03-21 23:59:27 +00:00
Paul Chechetin
1d6ca771d4 Fix issue with twice declaration of Database_user resource 2013-02-18 15:24:57 +04: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
Martin Dluhos
04537908a9 Added an option to specify db status. 2012-08-21 15:40:42 -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
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
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
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
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
Dan Bode
344d644d5c Added documentation and license to module. 2011-05-31 20:47:19 -07:00
Dan Bode
fa7f0ebf17 removed accidentally checked in swap file.
removed spurious logging from db class
2011-05-29 18:15:55 -07:00
Dan Bode
0b5cc21348 cleaned up style a little:
- updated mysql::ruby to use params value for
  package_name
- updated server to use params value for service
  and package
- clarified some param names to make them more
  consistent
2011-05-26 18:11:24 -07:00
Dan Bode
d28f0e0327 adding first commit for mysql. 2011-05-24 23:22:43 -07:00