|
19 | 19 | # Path to secret file containing temporary root password.
|
20 | 20 | # @param manage_config_file
|
21 | 21 | # Whether the MySQL configuration file should be managed. Valid values are `true`, `false`. Defaults to `true`.
|
| 22 | +# @param options |
| 23 | +# A hash of options structured like the override_options, but not merged with the default options. Use this if you don’t want your options merged with the default options. |
22 | 24 | # @param override_options
|
23 | 25 | # Specifies override options to pass into MySQL. Structured like a hash in the my.cnf file: See above for usage details.
|
24 | 26 | # @param package_ensure
|
|
52 | 54 | # @param create_root_my_cnf
|
53 | 55 | # Whether to create `/root/.my.cnf`. Valid values are `true`, `false`. Defaults to `true`. `create_root_my_cnf` allows creation of `/root/.my.cnf` independently of `create_root_user`. You can use this for a cluster setup with Galera where you want `/root/.my.cnf` to exist on all nodes.
|
54 | 56 | # @param users
|
55 |
| -# Optional hash of users to create, which are passed to [mysql_user](#mysql_user). |
| 57 | +# Optional hash of users to create, which are passed to [mysql_user](#mysql_user). |
56 | 58 | # @param grants
|
57 |
| -# Optional hash of grants, which are passed to [mysql_grant](#mysql_grant). |
| 59 | +# Optional hash of grants, which are passed to [mysql_grant](#mysql_grant). |
58 | 60 | # @param databases
|
59 |
| -# Optional hash of databases to create, which are passed to [mysql_database](#mysql_database). |
| 61 | +# Optional hash of databases to create, which are passed to [mysql_database](#mysql_database). |
60 | 62 | # @param enabled
|
61 | 63 | # _Deprecated_
|
62 | 64 | # @param manage_service
|
|
70 | 72 | $install_options = undef,
|
71 | 73 | $install_secret_file = $mysql::params::install_secret_file,
|
72 | 74 | $manage_config_file = $mysql::params::manage_config_file,
|
| 75 | + $options = {}, |
73 | 76 | $override_options = {},
|
74 | 77 | $package_ensure = $mysql::params::server_package_ensure,
|
75 | 78 | $package_manage = $mysql::params::server_package_manage,
|
|
115 | 118 | warning(translate('The `old_root_password` attribute is no longer used and will be removed in a future release.'))
|
116 | 119 | }
|
117 | 120 |
|
118 |
| - # Create a merged together set of options. Rightmost hashes win over left. |
119 |
| - $options = mysql::normalise_and_deepmerge($mysql::params::default_options, $override_options) |
| 121 | + if ! empty($options) and ! empty($override_options) { |
| 122 | + fail(translate('You can\'t specify $options and $override_options simultaneously, see the README section \'Customize server options\'!')) |
| 123 | + } |
| 124 | + |
| 125 | + # If override_options are set, create a merged together set of options. Rightmost hashes win over left. |
| 126 | + # If options are set, just use them. |
| 127 | + $_options = empty($options) ? { |
| 128 | + true => mysql::normalise_and_deepmerge($mysql::params::default_options, $override_options), |
| 129 | + false => $options, |
| 130 | + } |
120 | 131 |
|
121 | 132 | Class['mysql::server::root_password'] -> Mysql::Db <| |>
|
122 | 133 |
|
|
0 commit comments