File tree Expand file tree Collapse file tree 8 files changed +228
-0
lines changed Expand file tree Collapse file tree 8 files changed +228
-0
lines changed Original file line number Diff line number Diff line change
1
+ # @summary
2
+ # Installs `lbmethod_bybusyness`.
3
+ #
4
+ # @param apache_version
5
+ # Version of Apache to install module on.
6
+ #
7
+ # @see https://httpd.apache.org/docs/2.4/mod/mod_lbmethod_bybusyness.html for additional documentation.
8
+ #
9
+ class apache::mod::lbmethod_bybusyness (
10
+ Optional[String] $apache_version = $apache::apache_version,
11
+ ) {
12
+ require apache::mod::proxy_balancer
13
+
14
+ if versioncmp($apache_version , ' 2.3' ) >= 0 {
15
+ apache::mod { 'lbmethod_bybusyness' : }
16
+ } else {
17
+ fail(' Unsuported version for mod lbmethod_bybusyness' )
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ # @summary
2
+ # Installs `lbmethod_byrequests`.
3
+ #
4
+ # @param apache_version
5
+ # Version of Apache to install module on.
6
+ #
7
+ # @see https://httpd.apache.org/docs/2.4/mod/mod_lbmethod_byrequests.html for additional documentation.
8
+ #
9
+ class apache::mod::lbmethod_byrequests (
10
+ Optional[String] $apache_version = $apache::apache_version,
11
+ ) {
12
+ require apache::mod::proxy_balancer
13
+
14
+ if versioncmp($apache_version , ' 2.3' ) >= 0 {
15
+ apache::mod { 'lbmethod_byrequests' : }
16
+ } else {
17
+ fail(' Unsuported version for mod lbmethod_byrequests' )
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ # @summary
2
+ # Installs `lbmethod_bytraffic`.
3
+ #
4
+ # @param apache_version
5
+ # Version of Apache to install module on.
6
+ #
7
+ # @see https://httpd.apache.org/docs/2.4/mod/mod_lbmethod_bytraffic.html for additional documentation.
8
+ #
9
+ class apache::mod::lbmethod_bytraffic (
10
+ Optional[String] $apache_version = $apache::apache_version,
11
+ ) {
12
+ require apache::mod::proxy_balancer
13
+
14
+ if versioncmp($apache_version , ' 2.3' ) >= 0 {
15
+ apache::mod { 'lbmethod_bytraffic' : }
16
+ } else {
17
+ fail(' Unsuported version for mod lbmethod_bytraffic' )
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ # @summary
2
+ # Installs `lbmethod_heartbeat`.
3
+ #
4
+ # @param apache_version
5
+ # Version of Apache to install module on.
6
+ #
7
+ # @see https://httpd.apache.org/docs/2.4/mod/mod_lbmethod_heartbeat.html for additional documentation.
8
+ #
9
+ class apache::mod::lbmethod_heartbeat (
10
+ Optional[String] $apache_version = $apache::apache_version,
11
+ ) {
12
+ require apache::mod::proxy_balancer
13
+
14
+ if versioncmp($apache_version , ' 2.3' ) >= 0 {
15
+ apache::mod { 'lbmethod_heartbeat' : }
16
+ } else {
17
+ fail(' Unsuported version for mod lbmethod_heartbeat' )
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'apache::mod::lbmethod_byrequests' , type : :class do
6
+ context 'on a Debian OS' do
7
+ include_examples 'Debian 11'
8
+
9
+ context 'with Apache version >= 2.4' do
10
+ let :params do
11
+ {
12
+ apache_version : '2.4' ,
13
+ }
14
+ end
15
+
16
+ it {
17
+ is_expected . to contain_file ( '/etc/apache2/mods-enabled/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
18
+ 'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n " )
19
+ }
20
+ end
21
+ end
22
+ context 'on a RedHat OS' do
23
+ include_examples 'RedHat 6'
24
+
25
+ context 'with Apache version >= 2.4' do
26
+ let :params do
27
+ {
28
+ apache_version : '2.4' ,
29
+ }
30
+ end
31
+
32
+ it {
33
+ is_expected . to contain_file ( '/etc/httpd/conf.modules.d/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
34
+ 'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n " )
35
+ }
36
+ end
37
+ end
38
+ end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'apache::mod::lbmethod_byrequests' , type : :class do
6
+ context 'on a Debian OS' do
7
+ include_examples 'Debian 11'
8
+
9
+ context 'with Apache version >= 2.4' do
10
+ let :params do
11
+ {
12
+ apache_version : '2.4' ,
13
+ }
14
+ end
15
+
16
+ it {
17
+ is_expected . to contain_file ( '/etc/apache2/mods-enabled/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
18
+ 'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n " )
19
+ }
20
+ end
21
+ end
22
+ context 'on a RedHat OS' do
23
+ include_examples 'RedHat 6'
24
+
25
+ context 'with Apache version >= 2.4' do
26
+ let :params do
27
+ {
28
+ apache_version : '2.4' ,
29
+ }
30
+ end
31
+
32
+ it {
33
+ is_expected . to contain_file ( '/etc/httpd/conf.modules.d/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
34
+ 'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n " )
35
+ }
36
+ end
37
+ end
38
+ end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'apache::mod::lbmethod_byrequests' , type : :class do
6
+ context 'on a Debian OS' do
7
+ include_examples 'Debian 11'
8
+
9
+ context 'with Apache version >= 2.4' do
10
+ let :params do
11
+ {
12
+ apache_version : '2.4' ,
13
+ }
14
+ end
15
+
16
+ it {
17
+ is_expected . to contain_file ( '/etc/apache2/mods-enabled/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
18
+ 'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n " )
19
+ }
20
+ end
21
+ end
22
+ context 'on a RedHat OS' do
23
+ include_examples 'RedHat 6'
24
+
25
+ context 'with Apache version >= 2.4' do
26
+ let :params do
27
+ {
28
+ apache_version : '2.4' ,
29
+ }
30
+ end
31
+
32
+ it {
33
+ is_expected . to contain_file ( '/etc/httpd/conf.modules.d/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
34
+ 'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n " )
35
+ }
36
+ end
37
+ end
38
+ end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'apache::mod::lbmethod_byrequests' , type : :class do
6
+ context 'on a Debian OS' do
7
+ include_examples 'Debian 11'
8
+
9
+ context 'with Apache version >= 2.4' do
10
+ let :params do
11
+ {
12
+ apache_version : '2.4' ,
13
+ }
14
+ end
15
+
16
+ it {
17
+ is_expected . to contain_file ( '/etc/apache2/mods-enabled/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
18
+ 'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n " )
19
+ }
20
+ end
21
+ end
22
+ context 'on a RedHat OS' do
23
+ include_examples 'RedHat 6'
24
+
25
+ context 'with Apache version >= 2.4' do
26
+ let :params do
27
+ {
28
+ apache_version : '2.4' ,
29
+ }
30
+ end
31
+
32
+ it {
33
+ is_expected . to contain_file ( '/etc/httpd/conf.modules.d/lbmethod_byrequests.load' ) . with ( 'ensure' => 'file' ,
34
+ 'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n " )
35
+ }
36
+ end
37
+ end
38
+ end
You can’t perform that action at this time.
0 commit comments