comparison modules/apache/manifests/mod.pp @ 275:d9352a684e62

Mass update of modules to remove deprecation warnings
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 11:36:07 +0000
parents 675c1cc61eaf
children b8d6ada284dd
comparison
equal deleted inserted replaced
274:b2571c28fc27 275:d9352a684e62
1 # @summary
2 # Installs packages for an Apache module that doesn't have a corresponding
3 # `apache::mod::<MODULE NAME>` class.
4 #
5 # Checks for or places the module's default configuration files in the Apache server's
6 # `module` and `enable` directories. The default locations depend on your operating system.
7 #
8 # @param package
9 # **Required**.<br />
10 # Names the package Puppet uses to install the Apache module.
11 #
12 # @param package_ensure
13 # Determines whether Puppet ensures the Apache module should be installed.
14 #
15 # @param lib
16 # Defines the module's shared object name. Do not configure manually without special reason.
17 #
18 # @param lib_path
19 # Specifies a path to the module's libraries. Do not manually set this parameter
20 # without special reason. The `path` parameter overrides this value.
21 #
22 # @param loadfile_name
23 # Sets the filename for the module's `LoadFile` directive, which can also set
24 # the module load order as Apache processes them in alphanumeric order.
25 #
26 # @param id
27 # Specifies the package id
28 #
29 # @param loadfiles
30 # Specifies an array of `LoadFile` directives.
31 #
32 # @param path
33 # Specifies a path to the module. Do not manually set this parameter without a special reason.
34 #
1 define apache::mod ( 35 define apache::mod (
2 $package = undef, 36 $package = undef,
3 $package_ensure = 'present', 37 $package_ensure = 'present',
4 $lib = undef, 38 $lib = undef,
5 $lib_path = $::apache::lib_path, 39 $lib_path = $::apache::lib_path,
15 $mod = $name 49 $mod = $name
16 #include apache #This creates duplicate resources in rspec-puppet 50 #include apache #This creates duplicate resources in rspec-puppet
17 $mod_dir = $::apache::mod_dir 51 $mod_dir = $::apache::mod_dir
18 52
19 # Determine if we have special lib 53 # Determine if we have special lib
20 $mod_libs = $::apache::params::mod_libs 54 $mod_libs = $::apache::mod_libs
21 if $lib { 55 if $lib {
22 $_lib = $lib 56 $_lib = $lib
23 } elsif has_key($mod_libs, $mod) { # 2.6 compatibility hack 57 } elsif has_key($mod_libs, $mod) { # 2.6 compatibility hack
24 $_lib = $mod_libs[$mod] 58 $_lib = $mod_libs[$mod]
25 } else { 59 } else {
44 } else { 78 } else {
45 $_loadfile_name = "${mod}.load" 79 $_loadfile_name = "${mod}.load"
46 } 80 }
47 81
48 # Determine if we have a package 82 # Determine if we have a package
49 $mod_packages = $::apache::params::mod_packages 83 $mod_packages = $::apache::mod_packages
50 if $package { 84 if $package {
51 $_package = $package 85 $_package = $package
52 } elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack 86 } elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack
53 if ($::apache::apache_version == '2.4' and $::operatingsystem =~ /^[Aa]mazon$/) { 87 if ($::apache::apache_version == '2.4' and $::operatingsystem =~ /^[Aa]mazon$/ and $::operatingsystemmajrelease != '2') {
54 # On amazon linux we need to prefix our package name with mod24 instead of mod to support apache 2.4 88 # On amazon linux we need to prefix our package name with mod24 instead of mod to support apache 2.4
55 $_package = regsubst($mod_packages[$mod],'^(mod_)?(.*)','mod24_\2') 89 $_package = regsubst($mod_packages[$mod],'^(mod_)?(.*)','mod24_\2')
56 } else { 90 } else {
57 $_package = $mod_packages[$mod] 91 $_package = $mod_packages[$mod]
58 } 92 }