annotate modules/mysql/examples/monitor.pp @ 389:668df4711671

Update MySQL modules
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:16:21 +0000
parents
children c6c9a2cfcfbd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 # @summary
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 # Add a monitoring user to the database
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 $mysql_monitor_password = 'password'
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 $mysql_monitor_username = 'monitoring'
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 $mysql_monitor_hostname = $::facts['networking']['hostname']
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 mysql_user { "${mysql_monitor_username}@${mysql_monitor_hostname}":
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 password_hash => mysql::password($mysql_monitor_password),
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 require => Class['mysql::server::service'],
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 mysql_grant { "${mysql_monitor_username}@${mysql_monitor_hostname}/*.*":
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 user => "${mysql_monitor_username}@${mysql_monitor_hostname}",
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 table => '*.*',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 privileges => ['PROCESS', 'SUPER'],
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 require => Mysql_user["${mysql_monitor_username}@${mysql_monitor_hostname}"],
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 }