Puppet Class: mysql::server::monitor

Defined in:
manifests/server/monitor.pp

Summary

This is a helper class to add a monitoring user to the database

Overview

Parameters:

  • mysql_monitor_username (Any) (defaults to: '')

    The username to create for MySQL monitoring.

  • mysql_monitor_password (Any) (defaults to: '')

    The password to create for MySQL monitoring.

  • mysql_monitor_hostname (Any) (defaults to: '')

    The hostname from which the monitoring user requests are allowed access.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'manifests/server/monitor.pp', line 11

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,
    password_hash => mysql::password($mysql_monitor_password),
    require       => Class['mysql::server::service'],
  }

  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}"],
  }
}