annotate 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
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 }