view modules/mysql/examples/monitor.pp @ 442:2879e2d4148e

Configure test machine
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Apr 2023 19:41:02 +0100
parents 668df4711671
children c6c9a2cfcfbd
line wrap: on
line source

# @summary
#   Add a monitoring user to the database

$mysql_monitor_password = 'password'
$mysql_monitor_username = 'monitoring'
$mysql_monitor_hostname = $::facts['networking']['hostname']

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