Puppet Class: apache::version
- Defined in:
-
manifests/version.pp
Summary
Try to automatically detect the version by OS
Overview
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'manifests/version.pp', line 5
class apache::version (
Optional[String] $scl_httpd_version = undef,
Optional[String] $scl_php_version = undef,
) {
# This will be 5 or 6 on RedHat, 6 or wheezy on Debian, 12 or quantal on Ubuntu, etc.
$osr_array = split($::operatingsystemrelease,'[\/\.]')
$distrelease = $osr_array[0]
if ! $distrelease {
fail("Class['apache::version']: Unparsable \$::operatingsystemrelease: ${::operatingsystemrelease}")
}
case $::osfamily {
'RedHat': {
if $scl_httpd_version {
$default = $scl_httpd_version
}
elsif ($::operatingsystem == 'Amazon') {
$default = '2.2'
} elsif ($::operatingsystem == 'Fedora' and versioncmp($distrelease, '18') >= 0) or ($::operatingsystem != 'Fedora' and versioncmp($distrelease, '7') >= 0) {
$default = '2.4'
} else {
$default = '2.2'
}
}
'Debian': {
if $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '13.10') >= 0 {
$default = '2.4'
} elsif $::operatingsystem == 'Debian' and versioncmp($distrelease, '8') >= 0 {
$default = '2.4'
} else {
$default = '2.2'
}
}
'FreeBSD': {
$default = '2.4'
}
'Gentoo': {
$default = '2.4'
}
'Suse': {
if ($::operatingsystem == 'SLES' and versioncmp($::operatingsystemrelease, '12') >= 0) or ($::operatingsystem == 'OpenSuSE' and versioncmp($::operatingsystemrelease, '42') >= 0) {
$default = '2.4'
} else {
$default = '2.2'
}
}
default: {
fail("Class['apache::version']: Unsupported osfamily: ${::osfamily}")
}
}
}
|