2013-04-11 19:02:41 +02:00
|
|
|
#This is a helper class to add a monitoring user to the database
|
2011-06-01 05:47:19 +02:00
|
|
|
class mysql::server::monitor (
|
2015-04-15 23:25:37 +02:00
|
|
|
$mysql_monitor_username = '',
|
|
|
|
$mysql_monitor_password = '',
|
|
|
|
$mysql_monitor_hostname = ''
|
2011-06-01 05:47:19 +02:00
|
|
|
) {
|
|
|
|
|
2013-09-13 19:04:42 +02:00
|
|
|
Anchor['mysql::server::end'] -> Class['mysql::server::monitor']
|
2012-02-09 20:26:00 +01:00
|
|
|
|
2013-10-07 15:55:13 +02:00
|
|
|
mysql_user { "${mysql_monitor_username}@${mysql_monitor_hostname}":
|
2012-02-09 20:26:00 +01:00
|
|
|
ensure => present,
|
2012-09-04 15:59:47 +02:00
|
|
|
password_hash => mysql_password($mysql_monitor_password),
|
2013-10-07 15:55:13 +02:00
|
|
|
require => Class['mysql::server::service'],
|
2011-05-25 08:22:43 +02:00
|
|
|
}
|
2012-02-09 20:26:00 +01:00
|
|
|
|
2013-10-07 15:55:13 +02:00
|
|
|
mysql_grant { "${mysql_monitor_username}@${mysql_monitor_hostname}/*.*":
|
2013-08-29 00:03:51 +02:00
|
|
|
ensure => present,
|
|
|
|
user => "${mysql_monitor_username}@${mysql_monitor_hostname}",
|
|
|
|
table => '*.*',
|
2013-10-07 15:55:13 +02:00
|
|
|
privileges => [ 'PROCESS', 'SUPER' ],
|
2013-08-29 00:03:51 +02:00
|
|
|
require => Mysql_user["${mysql_monitor_username}@${mysql_monitor_hostname}"],
|
2011-05-25 08:22:43 +02:00
|
|
|
}
|
2012-02-09 20:26:00 +01:00
|
|
|
|
2011-05-25 08:22:43 +02:00
|
|
|
}
|