From 7824709cf82cf2c9b4d1ef860e6dbfe446642925 Mon Sep 17 00:00:00 2001 From: Thomas Bellman <bellman@nsc.liu.se> Date: Wed, 4 Apr 2018 18:49:35 +0200 Subject: [PATCH] Add variable $standard_version to apache class. This will hold the version (major.minor, e.g. "2.2" or "2.4") of Apache httpd that comes default with each operating system, so that other parts of this module can do things differently depending on the httpd version. Currently we know which httpd comes with EL-6 and EL-7. Note that this might not be the version that actually gets installed, if the user has extra package repositories configured. We could possibly let users declare which version is used with a parametrized class, but this will have to do for now. --- manifests/init.pp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index aeb1197..9e7aa27 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,6 +15,23 @@ class apache $configfile = '/etc/httpd/conf/httpd.conf' $configdir = '/etc/httpd/conf.d' $logdir = '/var/log/httpd' + + # The version of httpd that comes standard with an OS. + # This might not be the version that will actually be installed, though, + # but it is the best we can do. + # FIXME: Maybe allow users to override this with a parametrized class? + case "${::operatingsystem}:${::operatingsystemrelease}" + { + /^(RedHat|CentOS|Scientific):6(\..*)?$/: { + $standard_version = '2.2' + } + /^(RedHat|CentOS|Scientific):7(\..*)?$/: { + $standard_version = '2.4' + } + default: { + $standard_version = '' + } + } } -- GitLab