Module puppetlabs/mysql
| Download |
|
Module description
This module provides the capability to manage your mysql installation, users, permissions and databases.
This module has evolved and is originally based on work by David Schmitt. If anyone else was involved in the development of this module and wants credit, let Puppetlabs know.
The mysql module is composed of the following
Classes
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, starts service, sets root_pw, and sets root login information in /etc/.my.cnf and /root/.my.cnf.
class { 'mysql::server':
config_hash => { 'root_password' => 'foo' }
}
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
database { 'mydb':
charset => 'latin1',
}
database_user { 'bob@localhost':
password_hash => mysql_password('foo')
}
database_grant { 'user@localhost/database':
privileges => ['all'] ,
}
Bugs
Bugs can be reported in the Puppetlabs Redmine project:
http://projects.puppetlabs.com/projects/modules/
Just ensure you raise the bug with the category mysql.
Release notes for version 0.3.0
-
14218 Query the database for available privileges
- Add mysql::java class for java connector installation
- Use correct error log location on different distros
- Fix set_mysql_rootpw to properly depend on my.cnf
Types
database
Description
Manage databases.
Parameters
- name
The name of the database.
Properties
- ensure
The basic property that the resource should be in. Valid values are
present,absent.
- charset
The characterset to use for a database Values can match
/^\S+$/.
Providers
- default
This is a default provider that does nothing. This allows us to install mysql on the same puppet run where we want to use it.
- mysql
Manages MySQL database.
Required binaries:
mysql,mysqladmin. Default forkernel==Linux.
database_grant
Description
Manage a database user's rights.
Parameters
- name
The primary key: either user@host for global privilges or user@host/database for database specific privileges
Properties
- privileges
The privileges the user should have. The possible values are implementation dependent.
Providers
- default
Uses mysql as database.
- mysql
Uses mysql as database.
Required binaries:
mysql,mysqladmin. Default forkernel==Linux.
database_user
Description
Manage a database user. This includes management of users password as well as priveleges
Parameters
- name
The name of the user. This uses the ‘username@hostname’ or username@hostname.
Properties
- ensure
The basic property that the resource should be in. Valid values are
present,absent.
- password_hash
The password hash of the user. Use mysql_password() for creating such a hash. Values can match
/\w+/.
Providers
- default
manage users for a mysql database.
- mysql
manage users for a mysql database.
Required binaries:
mysql,mysqladmin. Default forkernel==Linux.