]> gitweb.fluxo.info Git - puppet-database.git/commitdiff
Fix section variable
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 19:06:57 +0000 (16:06 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 19:06:57 +0000 (16:06 -0300)
manifests/config.pp

index f931a457573a7010d170b96f7207b23c5705c7cd..887a7f426e4ef56b48d8a06432ee47a917ae5fb0 100644 (file)
@@ -5,15 +5,18 @@ define database::config(
 ) {
   # Guess section based on operating system and implementation
   $implementation = $::mysql::server::implementation
-  $section        = $implementation ? {
-    'mysql-server'   => $::lsbdistid ? {
-       'Ubuntu' => 'mysql.conf.d',
-       'Debian' => 'mariadb.conf.d',
-     },
-    'mariadb-server' => 'mariadb.conf.d',
-  }
+    $real_section = $section ? {
+      '' => $implementation ? {
+        'mysql-server' => $::lsbdistid ? {
+          'Ubuntu' => 'mysql.conf.d',
+          'Debian' => 'mariadb.conf.d',
+        },
+        'mariadb-server' => 'mariadb.conf.d',
+      },
+      default => $section,
+    }
 
-  file { "/etc/mysql/${section}/${name}.cnf":
+  file { "/etc/mysql/${real_section}/${name}.cnf":
     ensure  => $ensure,
     owner   => root,
     group   => root,