From 79441bf4fe7f6e4ebe708e2926d370cbd78cb396 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 17 May 2009 21:24:38 +0200 Subject: get rid off case statement --- manifests/defines/configuration.pp | 44 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'manifests') diff --git a/manifests/defines/configuration.pp b/manifests/defines/configuration.pp index f3ae200..a987157 100644 --- a/manifests/defines/configuration.pp +++ b/manifests/defines/configuration.pp @@ -91,33 +91,29 @@ define apache::vhost::webdir( $documentroot = "${real_path}/www" $logdir = "${real_path}/logs" - case $documentroot_owner { - apache: { - case $apache_default_user { - '': { - $real_documentroot_owner = $operatingsystem ? { - openbsd => 'www', - default => $documentroot_owner - } - } - default: { $real_documentroot_owner = $apache_default_user } - } + if $documentroot_owner == 'apache' { + if $apache_default_user == '' { + $real_documentroot_owner = $operatingsystem ? { + openbsd => 'www', + default => $documentroot_owner } - default: { $real_documentroot_owner = $documentroot_owner } + } else { + $real_documentroot_owner = $apache_default_user + } + } else { + $real_documentroot_owner = $documentroot_owner } - case $apache_group { - apache: { - case $apache_default_group { - '': { - $real_documentroot_group = $operatingsystem ? { - openbsd => 'www', - default => $documentroot_group - } - } - default: { $real_documentroot_group = $apache_default_group } - } + if $documentroot_group == 'apache' { + if $apache_default_group == '' { + $real_documentroot_group = $operatingsystem ? { + openbsd => 'www', + default => $documentroot_group } - default: { $real_documentroot_group = $documentroot_group } + } else { + $real_documentroot_group = $apache_default_group + } + } else { + $real_documentroot_group = $documentroot_group } case $ensure { absent: { -- cgit v1.2.3