Commit graph

42 commits

Author SHA1 Message Date
Tom Krouper
8b366fe7df Move config install before package install
This prevents mysqld from running without its intended configuration.
2016-03-25 09:01:31 -07: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
Morgan Haskel
e4b4afd000 Merge pull request #683 from eems-leo/remove-old-root-pass
Remove references to old_root_password (cleanup)
2015-05-05 12:10:56 -07:00
Julien Pivotto
c2b0b4cb2c Split package installation and database install
The current install pattern used by this module is the following:
1. Install package
2. Install the DB
3. Make the config files

In some cases this prevents MySQL to start, because some variables in
the config file have an impact on the DB installation.

Example with a custom innodb_data_file_path:
[ERROR] InnoDB: space header page consists of zero bytes in data file
/var/lib/mysql/ibdata

This commit changes the order to do:
1. Install package
2. Make the config files
3. Install the DB
2015-04-23 13:17:08 +02:00
Sebastian Reitenbach
5116883111 Fix regression introduced by adding OpenBSD support.
Add a $mysql_group parameter, and use that instead of the $root_group
parameter to define the group membership of the mysql error log file.
2015-03-18 08:47:25 +01:00
Jesse Cotton
a26b80d750 Remove default install root password if set 2015-03-17 15:21:07 +00:00
Jesse Cotton
5b692a8f62 Deprecate mysql::server::old_root_password 2015-03-13 13:58:04 +00: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
Damon Conway
7de2316e15 [MODULES-1484] Add support for install_options for all package resources.
Add install_options parameter to mysql::bindings, mysql::client, and
mysql::server. The default is undef.
2014-11-08 00:30:00 -06:00
Franz Schwartau
02564bfe08 Add new parameters create_root_user and create_root_my_cnf.
This allows the galera module and others to write ${::root_home}/.my.cnf
independently from create the mysql user. This is useful for cluster
setups where you want to create ${::root_home}/.my.cnf on every node
but create the user only once.
2014-10-06 10:53:30 +02:00
Lukas Bezdicka
26204437ef Prametrize !includedir
Hardcoded path provided by puppet is now replaced by providing only the final directory as on
most systems includedir is provided by package and it's matter of user to provide it if he
wants to override it. This also allows disabling including at all.
2014-06-04 14:07:49 +02: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
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
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
52a9f2e293 Duplicate parameter removed. 2013-10-03 19:10:35 -04:00
Justin Burnham
1b4a486bf9 Fixes issue #274 by using recursive hash merge. 2013-09-25 10:38:08 -07: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
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
Wolf Noble
2deb2b2da3 Remove trailing comma to server.pp for 2.6 backwards compatibility. 2013-04-24 15:38:05 -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
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
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
Erik Dalén
b670071d9f Fix lint warnings 2012-09-04 16:25:08 +02: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
Monty Taylor
8d97f5dca8 Add apparmor support. 2012-08-12 08:48:19 -04: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
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
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
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
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
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
a24881a682 Created config class and extended params.
It makes way more sense to just allow it as a 
class param.

Also added some additional config for setting bind
address and port.

Added management of /etc/mysql/my.cnf

Documented a dependency on create_resources 0.0.1
2011-06-22 11:38:11 -07:00
Gary Larizza
bba9589770 Fix service path
Restrict the path for the service binary to '/sbin/:/usr/sbin/'
2011-06-16 16:33:09 -07:00
Gary Larizza
c15ef0ad1b Remove path to service binary
This commit removes the path to the service binary (which didn't
work on CentOS) and instead added a path parameter.
2011-06-16 15:32:07 -07:00
Dan Bode
fb00c75ced Debian should not manage root password
- previously setting the root password failed on 
  Debian b/c a root password was already set
  during package installation
- Debian already installs mysql with a 
   maintainance user capable of performing any
   required database actions.
- this patch splits setting of root password to
  be redhat specific.
- as a consequence, users will not be able to 
  specify a root password on Debian (which 
  needs to be opened as a seperate ticket)
2011-06-16 10:49:15 -07:00
Dan Bode
b7761efd5b corrected /etc/my.cnf path 2011-06-01 20:20:11 -07:00
Dan Bode
344d644d5c Added documentation and license to module. 2011-05-31 20:47:19 -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