Skip to content

Commit

Permalink
Merge pull request puppetlabs#1537 from smortex/typo
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
LukasAud authored Jun 20, 2023
2 parents ec44f87 + a612646 commit a663739
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 25 deletions.
62 changes: 55 additions & 7 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@

#### Public Resource types

* [`mysql_grant`](#mysql_grant): @summary Manage a MySQL user's rights.
* [`mysql_database`](#mysql_database): Manage a MySQL database.
* [`mysql_grant`](#mysql_grant): Manage a MySQL user's rights.
* [`mysql_login_path`](#mysql_login_path): Manage a MySQL login path.
* [`mysql_plugin`](#mysql_plugin): Manage MySQL plugins.
* [`mysql_user`](#mysql_user): @summary Manage a MySQL user. This includes management of users password as well as privileges.
* [`mysql_user`](#mysql_user): Manage a MySQL user. This includes management of users password as well as privileges.

#### Private Resource types

* `mysql_database`: Manage a MySQL database.
* `mysql_datadir`: Manage MySQL datadirs with mysql_install_db OR mysqld (5.7.6 and above).

### Functions
Expand Down Expand Up @@ -1158,8 +1158,8 @@ The following parameters are available in the `mysql::db` defined type:
##### <a name="-mysql--db--name"></a>`name`

The name of the database to create. Database names must:
* be longer than 64 characters.
* not contain / \ or . characters.
* not be longer than 64 characters.
* not contain '/' '\' or '.' characters.
* not contain characters that are not permitted in file names.
* not end with space characters.

Expand Down Expand Up @@ -1281,9 +1281,58 @@ Default value: `undef`

## Resource types

### <a name="mysql_database"></a>`mysql_database`

Manage a MySQL database.

#### Properties

The following properties are available in the `mysql_database` type.

##### `charset`

Valid values: `%r{^\S+$}`

The CHARACTER SET setting for the database

Default value: `utf8`

##### `collate`

Valid values: `%r{^\S+$}`

The COLLATE setting for the database

Default value: `utf8_general_ci`

##### `ensure`

Valid values: `present`, `absent`

The basic property that the resource should be in.

Default value: `present`

#### Parameters

The following parameters are available in the `mysql_database` type.

* [`name`](#-mysql_database--name)
* [`provider`](#-mysql_database--provider)

##### <a name="-mysql_database--name"></a>`name`

namevar

The name of the MySQL database to manage.

##### <a name="-mysql_database--provider"></a>`provider`

The specific backend to use for this `mysql_database` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.

### <a name="mysql_grant"></a>`mysql_grant`

@summary
Manage a MySQL user's rights.

#### Properties
Expand Down Expand Up @@ -1483,7 +1532,6 @@ usually discover the appropriate provider for your platform.

### <a name="mysql_user"></a>`mysql_user`

@summary
Manage a MySQL user. This includes management of users password as well as privileges.

#### Properties
Expand Down
5 changes: 1 addition & 4 deletions lib/puppet/type/mysql_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

Puppet::Type.newtype(:mysql_database) do
@doc = <<-PUPPET
@summary
Manage a MySQL database.
@api private
@summary Manage a MySQL database.
PUPPET

ensurable
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/type/mysql_datadir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Puppet::Type.newtype(:mysql_datadir) do
@doc = <<-PUPPET
@summary
Manage MySQL datadirs with mysql_install_db OR mysqld (5.7.6 and above).
@summary Manage MySQL datadirs with mysql_install_db OR mysqld (5.7.6 and above).
@api private
PUPPET
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/type/mysql_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Puppet::Type.newtype(:mysql_grant) do
@doc = <<-PUPPET
@summary
Manage a MySQL user's rights.
@summary Manage a MySQL user's rights.
PUPPET
ensurable

Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/type/mysql_login_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
name: 'mysql_login_path',

docs: <<-DESCRIPTION,
@summary
Manage a MySQL login path.
@summary Manage a MySQL login path.
@see
https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor.html
@example
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/type/mysql_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Puppet::Type.newtype(:mysql_plugin) do
@doc = <<-PUPPET
@summary
Manage MySQL plugins.
@summary Manage MySQL plugins.
@example
mysql_plugin { 'some_plugin':
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/type/mysql_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# This has to be a separate type to enable collecting
Puppet::Type.newtype(:mysql_user) do
@doc = <<-PUPPET
@summary
Manage a MySQL user. This includes management of users password as well as privileges.
@summary Manage a MySQL user. This includes management of users password as well as privileges.
PUPPET

ensurable
Expand Down
8 changes: 4 additions & 4 deletions manifests/db.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#
# @param name
# The name of the database to create. Database names must:
# * be longer than 64 characters.
# * not contain / \ or . characters.
# * not be longer than 64 characters.
# * not contain '/' '\' or '.' characters.
# * not contain characters that are not permitted in file names.
# * not end with space characters.
# @param user
Expand Down Expand Up @@ -68,8 +68,8 @@
# Ensure that the database name is valid.
if $dbname !~ /^[^\/?%*:|\""<>.\s;]{1,64}$/ {
$message = "The database name '${dbname}' is invalid. Values must:
* be longer than 64 characters.
* not contain // \\ or . characters.
* not be longer than 64 characters.
* not contain '/' '\\' or '.' characters.
* not contain characters that are not permitted in file names.
* not end with space characters."
fail($message)
Expand Down

0 comments on commit a663739

Please sign in to comment.