Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Created April 11, 2012 23:42
Show Gist options
  • Save jeffmccune/2363508 to your computer and use it in GitHub Desktop.
Save jeffmccune/2363508 to your computer and use it in GitHub Desktop.
Puppet Database

Install the MySQL module in PE 2.5

This module is located at http://forge.puppetlabs.com/puppetlabs/mysql

Installing the module is a single command in PE 2.5

root@pe-centos6:~# puppet module install puppetlabs-mysql
Preparing to install into /etc/puppetlabs/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppetlabs/puppet/modules
└── puppetlabs-mysql (v0.2.0)

You can use the puppet describe command to see the new types:

root@pe-centos6:~# puppet describe --list | grep database
database        - Manage databases
database_grant  - Manage a database user's rights
database_user   - Manage a database user

And here's the detailed documentation about the 3 new types provided by this module:

database

root@pe-centos6:~# puppet describe database

Manage databases.

Parameters

  • charset The characterset to use for a database Values can match /^\S+$/.

  • ensure The basic property that the resource should be in. Valid values are present, absent.

  • name The name of the database.

Providers

default, mysql

database_user

root@pe-centos6:~# puppet describe database_user

Manage a database user. This includes management of users password as well as priveleges

Parameters

  • ensure The basic property that the resource should be in. Valid values are present, absent.

  • name The name of the user. This uses the 'username@hostname' or username@hostname.

  • password_hash The password hash of the user. Use mysql_password() for creating such a hash. Values can match /\w+/.

Providers

default, mysql

database_grant

Manage a database user's rights.

root@pe-centos6:~# puppet describe database_password

Parameters

  • name The primary key: either user@host for global privilges or user@host/database for database specific privileges

  • privileges The privileges the user should have. The possible values are implementation dependent.

Providers

default, mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment