|
5 | 5 | # mysql::db { 'mydb':
|
6 | 6 | # user => 'myuser',
|
7 | 7 | # password => 'mypass',
|
| 8 | +# plugin => 'caching_sha2_password', |
8 | 9 | # host => 'localhost',
|
9 | 10 | # grant => ['SELECT', 'UPDATE'],
|
10 | 11 | # }
|
|
19 | 20 | # The user for the database you're creating.
|
20 | 21 | # @param password
|
21 | 22 | # The password for $user for the database you're creating.
|
| 23 | +# @param plugin |
| 24 | +# The authentication plugin for $user for the database you're creating. Defaults to 'mysql_native_password'. |
22 | 25 | # @param tls_options
|
23 | 26 | # The tls_options for $user for the database you're creating.
|
24 | 27 | # @param dbname
|
|
47 | 50 | # Specify the path in which mysql has been installed if done in the non-standard bin/sbin path.
|
48 | 51 | #
|
49 | 52 | define mysql::db (
|
50 |
| - String[1] $user, |
51 |
| - Variant[String, Sensitive[String]] $password, |
52 |
| - Optional[Array[String[1]]] $tls_options = undef, |
53 |
| - String $dbname = $name, |
54 |
| - String[1] $charset = 'utf8', |
55 |
| - String[1] $collate = 'utf8_general_ci', |
56 |
| - String[1] $host = 'localhost', |
57 |
| - Variant[String[1], Array[String[1]]] $grant = 'ALL', |
58 |
| - Optional[Variant[String[1], Array[String[1]]]] $grant_options = undef, |
59 |
| - Optional[Array] $sql = undef, |
60 |
| - Boolean $enforce_sql = false, |
61 |
| - Enum['absent', 'present'] $ensure = 'present', |
62 |
| - Integer $import_timeout = 300, |
63 |
| - Enum['cat', 'zcat', 'bzcat'] $import_cat_cmd = 'cat', |
64 |
| - Optional[String] $mysql_exec_path = undef, |
| 53 | + String[1] $user, |
| 54 | + Variant[String, Sensitive[String]] $password, |
| 55 | + String[1] $plugin ='mysql_native_password', |
| 56 | + Optional[Array[String[1]]] $tls_options = undef, |
| 57 | + String $dbname = $name, |
| 58 | + String[1] $charset = 'utf8', |
| 59 | + String[1] $collate = 'utf8_general_ci', |
| 60 | + String[1] $host = 'localhost', |
| 61 | + Variant[String[1], Array[String[1]]] $grant = 'ALL', |
| 62 | + Optional[Variant[String[1], Array[String[1]]]] $grant_options = undef, |
| 63 | + Optional[Array] $sql = undef, |
| 64 | + Boolean $enforce_sql = false, |
| 65 | + Enum['absent', 'present'] $ensure = 'present', |
| 66 | + Integer $import_timeout = 300, |
| 67 | + Enum['cat', 'zcat', 'bzcat'] $import_cat_cmd = 'cat', |
| 68 | + Optional[String] $mysql_exec_path = undef, |
65 | 69 | ) {
|
66 | 70 | include 'mysql::client'
|
67 | 71 |
|
|
103 | 107 | $user_resource = {
|
104 | 108 | ensure => $ensure,
|
105 | 109 | password_hash => Deferred('mysql::password', [$password]),
|
| 110 | + plugin => $plugin, |
106 | 111 | tls_options => $tls_options,
|
107 | 112 | }
|
108 | 113 | ensure_resource('mysql_user', "${user}@${host}", $user_resource)
|
|
0 commit comments