diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-04-12 16:06:57 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-04-12 16:06:57 -0300 |
commit | 6e67ade0e843ff1567f99b9cba423fe88373016c (patch) | |
tree | ec0ce1bd36a08f0d0575107ec5fd73596fecf530 | |
parent | 4a831eaaa1673a54c8224cf5da66165a1a227e12 (diff) | |
download | puppet-database-6e67ade0e843ff1567f99b9cba423fe88373016c.tar.gz puppet-database-6e67ade0e843ff1567f99b9cba423fe88373016c.tar.bz2 |
Fix section variable
-rw-r--r-- | manifests/config.pp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/manifests/config.pp b/manifests/config.pp index f931a45..887a7f4 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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, |