From 2f0c4cc24c7088705a6b30ab939ef00e90cb0903 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 12 Apr 2018 16:04:08 -0300 Subject: Guess section based on operating system and implementation at database::config --- manifests/config.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index f1d45be..2bda473 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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, -- cgit v1.2.3