Better hiera integration
This adds hash parameters to mysql::server to allow specifying grants, users, and databases to create automatically, which works nicely with Hiera's automatic parameter lookup functionality
This commit is contained in:
parent
911dbe5c1a
commit
d66efd82a2
2 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,10 @@ class mysql::server (
|
|||
$service_manage = $mysql::params::server_service_manage,
|
||||
$service_name = $mysql::params::server_service_name,
|
||||
$service_provider = $mysql::params::server_service_provider,
|
||||
$users = {},
|
||||
$grants = {},
|
||||
$databases = {},
|
||||
|
||||
# Deprecated parameters
|
||||
$enabled = undef,
|
||||
$manage_service = undef
|
||||
|
@ -43,6 +47,7 @@ class mysql::server (
|
|||
include '::mysql::server::config'
|
||||
include '::mysql::server::service'
|
||||
include '::mysql::server::root_password'
|
||||
include '::mysql::server::providers'
|
||||
|
||||
if $remove_default_accounts {
|
||||
class { '::mysql::server::account_security':
|
||||
|
@ -58,6 +63,7 @@ class mysql::server (
|
|||
Class['mysql::server::config'] ->
|
||||
Class['mysql::server::service'] ->
|
||||
Class['mysql::server::root_password'] ->
|
||||
Class['mysql::server::providers'] ->
|
||||
Anchor['mysql::server::end']
|
||||
|
||||
}
|
||||
|
|
6
manifests/server/providers.pp
Normal file
6
manifests/server/providers.pp
Normal file
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
class mysql::server::providers {
|
||||
create_resources('mysql_user', $mysql::server::users)
|
||||
create_resources('mysql_grant', $mysql::server::grants)
|
||||
create_resources('mysql_database', $mysql::server::databases)
|
||||
}
|
Loading…
Reference in a new issue