2015-04-15 23:25:37 +02:00
|
|
|
# See README.md.
|
2012-04-24 08:41:12 +02:00
|
|
|
class mysql::server::account_security {
|
2013-08-18 02:54:02 +02:00
|
|
|
mysql_user {
|
2015-01-10 17:17:35 +01:00
|
|
|
[ 'root@127.0.0.1',
|
2013-04-11 19:02:41 +02:00
|
|
|
'root@::1',
|
|
|
|
'@localhost',
|
|
|
|
'@%']:
|
2012-04-24 08:41:12 +02:00
|
|
|
ensure => 'absent',
|
2013-09-13 19:04:42 +02:00
|
|
|
require => Anchor['mysql::server::end'],
|
2012-04-24 08:41:12 +02:00
|
|
|
}
|
2015-01-10 17:17:35 +01:00
|
|
|
if ($::fqdn != 'localhost.localdomain') {
|
|
|
|
mysql_user {
|
2015-02-10 00:30:55 +01:00
|
|
|
[ 'root@localhost.localdomain',
|
|
|
|
'@localhost.localdomain']:
|
2015-01-10 17:17:35 +01:00
|
|
|
ensure => 'absent',
|
|
|
|
require => Anchor['mysql::server::end'],
|
|
|
|
}
|
|
|
|
}
|
2016-06-07 19:41:46 +02:00
|
|
|
if ($::fqdn and $::fqdn != 'localhost') {
|
2015-01-10 17:17:35 +01:00
|
|
|
mysql_user {
|
|
|
|
[ "root@${::fqdn}",
|
|
|
|
"@${::fqdn}"]:
|
2012-10-29 05:40:11 +01:00
|
|
|
ensure => 'absent',
|
2013-09-13 19:04:42 +02:00
|
|
|
require => Anchor['mysql::server::end'],
|
2012-10-29 05:40:11 +01:00
|
|
|
}
|
|
|
|
}
|
2015-01-10 17:17:35 +01:00
|
|
|
if ($::fqdn != $::hostname) {
|
|
|
|
if ($::hostname != 'localhost') {
|
|
|
|
mysql_user { ["root@${::hostname}", "@${::hostname}"]:
|
|
|
|
ensure => 'absent',
|
|
|
|
require => Anchor['mysql::server::end'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-18 02:54:02 +02:00
|
|
|
mysql_database { 'test':
|
2012-04-24 08:41:12 +02:00
|
|
|
ensure => 'absent',
|
2013-09-13 19:04:42 +02:00
|
|
|
require => Anchor['mysql::server::end'],
|
2012-04-24 08:41:12 +02:00
|
|
|
}
|
|
|
|
}
|