This repository was archived by the owner on Jun 11, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 49
49
) {
50
50
51
51
if $remote_host == ' ' {
52
- require mysql
52
+ include mysql
53
53
}
54
54
55
55
$dbname = $mysql_db ? {
Original file line number Diff line number Diff line change 223
223
#
224
224
class mysql (
225
225
$root_password = params_lookup( ' root_password' ),
226
+ $root_cnf_template = params_lookup( ' root_cnf_template' ),
226
227
$password_salt = params_lookup( ' password_salt' ),
227
228
$my_class = params_lookup( ' my_class' ),
228
229
$source = params_lookup( ' source' ),
264
265
$log_dir = params_lookup( ' log_dir' ),
265
266
$log_file = params_lookup( ' log_file' ),
266
267
$port = params_lookup( ' port' ),
267
- $protocol = params_lookup( ' protocol' )
268
+ $protocol = params_lookup( ' protocol' ),
269
+ $grants = params_lookup( ' grants' ),
270
+ $users = params_lookup( ' users' )
268
271
) inherits mysql::params {
269
272
270
273
$bool_source_dir_purge =any2bool($source_dir_purge )
415
418
include $mysql::my_class
416
419
}
417
420
421
+ # ## Create instances for integration with Hiera
422
+ if $grants != {} {
423
+ validate_hash($grants )
424
+ create_resources(mysql::grant, $grants )
425
+ }
426
+
427
+ if $users != {} {
428
+ validate_hash($users )
429
+ create_resources(mysql::user, $users )
430
+ }
431
+
418
432
419
433
# ## Provide puppi data, if enabled ( puppi => true )
420
434
if $mysql::bool_puppi == true {
Original file line number Diff line number Diff line change 16
16
17
17
# ## Module specific parameters
18
18
$root_password = ' '
19
+ $root_cnf_template = ' mysql/root.my.cnf.erb'
19
20
$password_salt = ' '
20
21
21
22
# ## Application related parameters
125
126
$puppi_helper = ' standard'
126
127
$debug = false
127
128
$audit_only = false
129
+ $grants = {}
130
+ $users = {}
128
131
129
132
}
Original file line number Diff line number Diff line change 6
6
class mysql::password {
7
7
8
8
# Load the variables used in this module. Check the params.pp file
9
- require mysql
9
+ include mysql
10
10
require mysql::params
11
11
12
12
if ! defined (File [' /root/.my.cnf' ]) {
16
16
mode => ' 0400' ,
17
17
owner => $mysql::config_file_owner ,
18
18
group => $mysql::config_file_group ,
19
- content => template (' mysql/root.my.cnf.erb ' ),
19
+ content => template ($ mysql::root_cnf_template ),
20
20
# replace => false,
21
21
# require => Exec['mysql_root_password'],
22
22
}
You can’t perform that action at this time.
0 commit comments