]> gitweb.fluxo.info Git - puppet-database.git/commitdiff
Guess section based on operating system and implementation at database::config
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 19:04:08 +0000 (16:04 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 12 Apr 2018 19:04:08 +0000 (16:04 -0300)
manifests/config.pp

index f1d45be9396dedd3906cd240aa15fe65c92dc1df..2bda473bdc7a2f242629f4a8a689b9b3ae0fbe0d 100644 (file)
@@ -1,8 +1,18 @@
 define database::config(
   $value,
-  $section = 'conf.d',
+  $section = '',
   $ensure  = 'present'
 ) {
+  # 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',
+  }
+
   file { "/etc/mysql/${section}/${name}.cnf":
     ensure  => $ensure,
     owner   => root,