diff modules/mysql/manifests/server/account_security.pp @ 26:58d1818c2ded puppet-3.6

Update MySQL module (which adds "staging" module)
author IBBoard <dev@ibboard.co.uk>
date Mon, 09 Mar 2015 01:34:59 +0000
parents 956e484adc12
children 48d3a1948e4d
line wrap: on
line diff
--- a/modules/mysql/manifests/server/account_security.pp	Mon Mar 09 00:58:19 2015 +0000
+++ b/modules/mysql/manifests/server/account_security.pp	Mon Mar 09 01:34:59 2015 +0000
@@ -1,20 +1,36 @@
 class mysql::server::account_security {
   mysql_user {
-    [ "root@${::fqdn}",
-      'root@127.0.0.1',
+    [ 'root@127.0.0.1',
       'root@::1',
-      "@${::fqdn}",
       '@localhost',
       '@%']:
     ensure  => 'absent',
     require => Anchor['mysql::server::end'],
   }
-  if ($::fqdn != $::hostname) {
-    mysql_user { ["root@${::hostname}", "@${::hostname}"]:
+  if ($::fqdn != 'localhost.localdomain') {
+    mysql_user {
+      [ 'root@localhost.localdomain',
+        '@localhost.localdomain']:
       ensure  => 'absent',
       require => Anchor['mysql::server::end'],
     }
   }
+  if ($::fqdn != 'localhost') {
+    mysql_user {
+      [ "root@${::fqdn}",
+        "@${::fqdn}"]:
+      ensure  => 'absent',
+      require => Anchor['mysql::server::end'],
+    }
+  }
+  if ($::fqdn != $::hostname) {
+    if ($::hostname != 'localhost') {
+      mysql_user { ["root@${::hostname}", "@${::hostname}"]:
+        ensure  => 'absent',
+        require => Anchor['mysql::server::end'],
+      }
+    }
+  }
   mysql_database { 'test':
     ensure  => 'absent',
     require => Anchor['mysql::server::end'],