Module undine_percona
In: /vagrant/modules/undine_percona/lib/puppet/parser/functions/convert_grants_to_resources.rb
/vagrant/modules/undine_percona/manifests/database.pp
/vagrant/modules/undine_percona/manifests/init.pp
/vagrant/modules/undine_percona/manifests/misc_conf_file.pp
/vagrant/modules/undine_percona/manifests/user.pp
/vagrant/modules/undine_percona/lib/puppet/parser/functions/convert_grants_to_resources.rb
/vagrant/modules/undine_percona/manifests/database.pp
/vagrant/modules/undine_percona/manifests/init.pp
/vagrant/modules/undine_percona/manifests/misc_conf_file.pp
/vagrant/modules/undine_percona/manifests/user.pp

Defines

Plugins

convert_grants_to_resources   convert_grants_to_resources  

Classes and Modules

Class undine_percona::undine_percona

Defines

database( $src_hostname => 'undef', $src_ssh_user => 'undef', $su_user => 'root', $db_name => 'title', $src_db_name => 'undef', $src_db_pass => 'undef', $su_pass => 'undef', $src_ssh_known_host_key => 'undef', $charset => 'undef', $collation => 'undef', $src_db_user => 'undef' )

Define: database

The database resource is used by Undine to represent a single Percona Server database. This may represent a pristine database, or one imported via a local database dump.

Optionally, the declaration may also declare include a remote source for the database, in which case it will be retrieved via mysqldump over SSH. To ensure that the database will not be inadvertently clobbered during provisioning, it will only be retrieved when the local database defined in db_name is empty (SHOW TABLES returns an empty set).

Parameters

db_name
The name of the MySQL database. Defaults to the resource title.
src_path
Optional. The local source path of a SQL database dump to import. Mutually exclusive with the src_ssh parameters.
src_ssh_user
Optional. The remote ssh user to use when connecting to the database.
src_hostname
Optional. The host on which the remote database resides. Must be supplied when retrieving a database from a remote host via SSH.
src_ssh_known_host_key
Optional. The known_host key of the remote host to connect to when retrieving a database from a remote host via SSH.
src_db_name
Optional. The remote database to connect to when retrieving a database dump. Must be supplied when retrieving a database from a remote host via SSH.
src_db_user
Optional. The database user to use when connecting to the remote database. Must be supplied when retrieving a database from a remote host via SSH.
src_db_pass
Optional. The password to use when connecting to the remote database.
charset
Optional. The character set to use.
collation
Optional. The default database collation to use.
su_user
Optional. The database superuser name to use when creating the database. Defaults to root.
su_pass
Optional. The database superuser password to use when creating the database. No password is set by default.

Examples

Creates a new database called "mysite_db" with the latin1 character set, using the latin1_swedish_ci collation.

undine_percona::database { ‘mysite_db’:

  charset => 'latin1',
  collation => 'latin1_swedish_ci',

}

Creates a new database called "mysite_db" (with the default character set and collation) from user@ssh.example.com via SSH, connecting to the database rmdb as remote_mysql_user:correcthorsebatterystaple. Note that the host is added to known_hosts using src_ssh_known_host_key.

  undine_percona::database { 'mysite_db':
    src_ssh_user => 'user',
    src_hostname => 'ssh.example.com',
    src_ssh_known_host_key => '|1|nddsvUkIUHNdM31TTSc+sPT57yg=|nQqEyJJthk/ ...',
    src_db_name => 'rmdb',
    src_db_user => 'remote_mysql_user',
    src_db_pass => 'correcthorsebatterystaple',
  }
database( $src_hostname => 'undef', $src_ssh_user => 'undef', $su_user => 'root', $db_name => 'title', $src_db_name => 'undef', $src_db_pass => 'undef', $su_pass => 'undef', $src_ssh_known_host_key => 'undef', $charset => 'undef', $collation => 'undef', $src_db_user => 'undef' )

Define: database

The database resource is used by Undine to represent a single Percona Server database. This may represent a pristine database, or one imported via a local database dump.

Optionally, the declaration may also declare include a remote source for the database, in which case it will be retrieved via mysqldump over SSH. To ensure that the database will not be inadvertently clobbered during provisioning, it will only be retrieved when the local database defined in db_name is empty (SHOW TABLES returns an empty set).

Parameters

db_name
The name of the MySQL database. Defaults to the resource title.
src_path
Optional. The local source path of a SQL database dump to import. Mutually exclusive with the src_ssh parameters.
src_ssh_user
Optional. The remote ssh user to use when connecting to the database.
src_hostname
Optional. The host on which the remote database resides. Must be supplied when retrieving a database from a remote host via SSH.
src_ssh_known_host_key
Optional. The known_host key of the remote host to connect to when retrieving a database from a remote host via SSH.
src_db_name
Optional. The remote database to connect to when retrieving a database dump. Must be supplied when retrieving a database from a remote host via SSH.
src_db_user
Optional. The database user to use when connecting to the remote database. Must be supplied when retrieving a database from a remote host via SSH.
src_db_pass
Optional. The password to use when connecting to the remote database.
charset
Optional. The character set to use.
collation
Optional. The default database collation to use.
su_user
Optional. The database superuser name to use when creating the database. Defaults to root.
su_pass
Optional. The database superuser password to use when creating the database. No password is set by default.

Examples

Creates a new database called "mysite_db" with the latin1 character set, using the latin1_swedish_ci collation.

undine_percona::database { ‘mysite_db’:

  charset => 'latin1',
  collation => 'latin1_swedish_ci',

}

Creates a new database called "mysite_db" (with the default character set and collation) from user@ssh.example.com via SSH, connecting to the database rmdb as remote_mysql_user:correcthorsebatterystaple. Note that the host is added to known_hosts using src_ssh_known_host_key.

  undine_percona::database { 'mysite_db':
    src_ssh_user => 'user',
    src_hostname => 'ssh.example.com',
    src_ssh_known_host_key => '|1|nddsvUkIUHNdM31TTSc+sPT57yg=|nQqEyJJthk/ ...',
    src_db_name => 'rmdb',
    src_db_user => 'remote_mysql_user',
    src_db_pass => 'correcthorsebatterystaple',
  }
misc_conf_file( $source => 'undef', $path => 'title', $ensure => 'file', $content => 'undef' )

Define: misc_conf_file

The misc_conf_file resource represents a single configuration file to manage, triggering an restart of the Percona server when modified. Fundamentally, this is a wrapper around a file resource that notifies the Percona service.

Parameters

content
The raw content to use for the file, as a string. Mutually exclusive with source.
source
A source file, which will be copied into place on the local system, with the same usage as the file resource. Mutually exclusive with content.
ensure
Optional. Whether and what type of file should exist, as defined by the file resource, with the exception of link. Defaults to file.
path
Optional. The destination path of the file. Defaults to the resource title.

Examples

  undine_percona::misc_conf_file { '/etc/mysql/conf.d/override.cnf':
    source => 'puppet:///modules/my_percona_module/override.cnf',
  }
misc_conf_file( $source => 'undef', $path => 'title', $ensure => 'file', $content => 'undef' )

Define: misc_conf_file

The misc_conf_file resource represents a single configuration file to manage, triggering an restart of the Percona server when modified. Fundamentally, this is a wrapper around a file resource that notifies the Percona service.

Parameters

content
The raw content to use for the file, as a string. Mutually exclusive with source.
source
A source file, which will be copied into place on the local system, with the same usage as the file resource. Mutually exclusive with content.
ensure
Optional. Whether and what type of file should exist, as defined by the file resource, with the exception of link. Defaults to file.
path
Optional. The destination path of the file. Defaults to the resource title.

Examples

  undine_percona::misc_conf_file { '/etc/mysql/conf.d/override.cnf':
    source => 'puppet:///modules/my_percona_module/override.cnf',
  }
user( $grants => 'undef', $su_user => 'root', $su_pass => 'undef', $username => 'title', $password )

TODO: Add condition to confirm structure of grants hash.

user( $grants => 'undef', $su_user => 'root', $su_pass => 'undef', $username => 'title', $password )

TODO: Add condition to confirm structure of grants hash.

[Validate]