No description
Find a file
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
files (#12412) mysqltuner.pl update 2012-02-04 07:08:08 +11:00
lib/puppet Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
manifests Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
spec Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
templates Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
tests Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
.gitignore ignore swap files 2011-05-26 17:59:01 -07:00
CHANGELOG Release 0.0.1 2011-06-03 13:38:29 -07:00
LICENSE Added documentation and license to module. 2011-05-31 20:47:19 -07:00
Modulefile Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
Rakefile Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
README.md Major refactor of mysql module. 2012-03-13 15:19:53 -07:00
TODO added some additional TODOS 2011-06-03 13:27:44 -07:00

Mysql module for Puppet

This module manages mysql on Linux (RedHat/Debian) distros. A native mysql provider implements database resource type to handle database, database user, and database permission.

Description

This module is based on work by David Schmitt. The following contributor have contributed patches to this module (beyond Puppet Labs):

  • Christian G. Warden
  • Daniel Black
  • Justin Ellison
  • Lowe Schmidt
  • Matthias Pigulla
  • William Van Hevelingen

Usage

mysql

Installs the mysql-client package.

class { 'mysql': }

mysql::python

Installs mysql bindings for python.

class { 'mysql::python': }

mysql::ruby

Installs mysql bindings for ruby.

class { 'mysql::ruby': }

mysql::server

Installs mysql-server packages, configures my.cnf and starts mysqld service:

class { 'mysql::server':
  config_hash => { 'root_password' => 'foo' }
}

Database login information stored in /root/.my.cnf.

mysql::db

Creates a database with a user and assign some privileges.

mysql::db { 'mydb':
  user     => 'myuser',
  password => 'mypass',
  host     => 'localhost',
  grant    => ['all'],
}

Providers for database types:

MySQL provider supports puppet resources command:

$ puppet resource database
database { 'information_schema':
  ensure  => 'present',
  charset => 'utf8',
}
database { 'mysql':
  ensure  => 'present',
  charset => 'latin1',
}

The custom resources can be used in any other manifests:

database { 'mydb':
  charset => 'latin1',
}

database_user { 'bob@localhost':
  password_hash => mysql_password('foo')
}

database_grant { 'user@localhost/database':
  privileges => ['all'] ,
}

A resource default can be specified to handle dependency:

Database {
  require => Class['mysql::server'],
}