From 649bc16416b773387741ccf64c9bde05bb3ef2e8 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Sun, 28 Oct 2012 21:40:11 -0700 Subject: [PATCH] account security should not fail if hostname == fqdn This commit checks that hostaname and fqdn are not equal before trying to remove both. --- manifests/server/account_security.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manifests/server/account_security.pp b/manifests/server/account_security.pp index a7054dc..9df64c0 100644 --- a/manifests/server/account_security.pp +++ b/manifests/server/account_security.pp @@ -1,11 +1,17 @@ class mysql::server::account_security { # Some installations have some default users which are not required. # We remove them here. You can subclass this class to overwrite this behavior. - database_user { [ "root@${::fqdn}", "root@${::hostname}", 'root@127.0.0.1', 'root@::1', - "@${::fqdn}", "@${::hostname}", '@localhost', '@%' ]: + database_user { [ "root@${::fqdn}", 'root@127.0.0.1', 'root@::1', + "@${::fqdn}", '@localhost', '@%' ]: ensure => 'absent', require => Class['mysql::config'], } + if ($::fqdn != $::hostname) { + database_user { ["root@${::hostname}", "@${::hostname}"]: + ensure => 'absent', + require => Class['mysql::config'], + } + } database { 'test': ensure => 'absent', require => Class['mysql::config'],