module-puppetlabs-mysql/manifests/server/monitor.pp

25 lines
818 B
ObjectPascal
Raw Normal View History

#This is a helper class to add a monitoring user to the database
class mysql::server::monitor (
$mysql_monitor_username = '',
$mysql_monitor_password = '',
$mysql_monitor_hostname = ''
) {
Anchor['mysql::server::end'] -> Class['mysql::server::monitor']
mysql_user { "${mysql_monitor_username}@${mysql_monitor_hostname}":
ensure => present,
2012-09-04 15:59:47 +02:00
password_hash => mysql_password($mysql_monitor_password),
require => Class['mysql::server::service'],
2011-05-25 08:22:43 +02:00
}
mysql_grant { "${mysql_monitor_username}@${mysql_monitor_hostname}/*.*":
ensure => present,
user => "${mysql_monitor_username}@${mysql_monitor_hostname}",
table => '*.*',
privileges => [ 'PROCESS', 'SUPER' ],
require => Mysql_user["${mysql_monitor_username}@${mysql_monitor_hostname}"],
2011-05-25 08:22:43 +02:00
}
2011-05-25 08:22:43 +02:00
}