Skip to content

Commit 240197f

Browse files
committed
Fix module usage with strict_variables
1 parent 024d983 commit 240197f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+500
-9
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
- PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
1515
- PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
1616
- PUPPET_GEM_VERSION="~> 3.0"
17+
- PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes"
1718
matrix:
1819
fast_finish: true
1920
exclude:

manifests/mod.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
$_package = $package
5454
} elsif $mod_package {
5555
$_package = $mod_package
56+
} else {
57+
$_package = undef
5658
}
5759
if $_package and ! defined(Package[$_package]) {
5860
# note: FreeBSD/ports uses apxs tool to activate modules; apxs clutters

manifests/mod/proxy_html.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
case $::osfamily {
77
/RedHat|FreeBSD/: {
88
::apache::mod { 'xml2enc': }
9+
$loadfiles = undef
910
}
1011
'Debian': {
1112
$gnu_path = $::hardwaremodel ? {

manifests/package.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class apache::package (
22
$ensure = 'present',
33
$mpm_module = $::apache::params::mpm_module,
4-
) {
4+
) inherits ::apache::params {
55
case $::osfamily {
66
'freebsd' : {
77
$all_mpms = [

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
$conf_dir = "${httpd_dir}/conf"
4040
$confd_dir = "${httpd_dir}/conf.d"
4141
$mod_dir = "${httpd_dir}/conf.d"
42+
$mod_enable_dir = undef
4243
$vhost_dir = "${httpd_dir}/conf.d"
44+
$vhost_enable_dir = undef
4345
$conf_file = 'httpd.conf'
4446
$ports_file = "${conf_dir}/ports.conf"
4547
$logroot = '/var/log/httpd'

manifests/vhost.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
$listen_addr_port = "${ip}:${port}"
328328
$nvh_addr_port = "${ip}:${port}"
329329
} else {
330+
$listen_addr_port = undef
330331
$nvh_addr_port = $ip
331332
if ! $servername and ! $ip_based {
332333
fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters for name-based vhosts")
@@ -337,6 +338,7 @@
337338
$listen_addr_port = $port
338339
$nvh_addr_port = "${vhost_name}:${port}"
339340
} else {
341+
$listen_addr_port = undef
340342
$nvh_addr_port = $name
341343
if ! $servername {
342344
fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters, and/or 'servername' parameter")

spec/classes/apache_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
context "on a Debian OS" do
55
let :facts do
66
{
7+
:id => 'root',
8+
:kernel => 'Linux',
9+
:lsbdistcodename => 'squeeze',
710
:osfamily => 'Debian',
11+
:operatingsystem => 'Debian',
812
:operatingsystemrelease => '6',
13+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
914
:concat_basedir => '/dne',
1015
}
1116
end
@@ -165,6 +170,7 @@
165170
context "13.10" do
166171
let :facts do
167172
super().merge({
173+
:lsbdistrelease => '13.10',
168174
:operatingsystemrelease => '13.10'
169175
})
170176
end
@@ -173,6 +179,7 @@
173179
context "12.04" do
174180
let :facts do
175181
super().merge({
182+
:lsbdistrelease => '12.04',
176183
:operatingsystemrelease => '12.04'
177184
})
178185
end
@@ -181,6 +188,7 @@
181188
context "13.04" do
182189
let :facts do
183190
super().merge({
191+
:lsbdistrelease => '13.04',
184192
:operatingsystemrelease => '13.04'
185193
})
186194
end
@@ -191,9 +199,13 @@
191199
context "on a RedHat 5 OS" do
192200
let :facts do
193201
{
202+
:id => 'root',
203+
:kernel => 'Linux',
194204
:osfamily => 'RedHat',
205+
:operatingsystem => 'RedHat',
195206
:operatingsystemrelease => '5',
196207
:concat_basedir => '/dne',
208+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
197209
}
198210
end
199211
it { should contain_class("apache::params") }
@@ -444,9 +456,13 @@
444456
context "on a FreeBSD OS" do
445457
let :facts do
446458
{
459+
:id => 'root',
460+
:kernel => 'FreeBSD',
447461
:osfamily => 'FreeBSD',
462+
:operatingsystem => 'FreeBSD',
448463
:operatingsystemrelease => '9',
449464
:concat_basedir => '/dne',
465+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
450466
}
451467
end
452468
it { should contain_class("apache::params") }
@@ -516,9 +532,13 @@
516532
context 'on all OSes' do
517533
let :facts do
518534
{
535+
:id => 'root',
536+
:kernel => 'Linux',
519537
:osfamily => 'RedHat',
538+
:operatingsystem => 'RedHat',
520539
:operatingsystemrelease => '6',
521540
:concat_basedir => '/dne',
541+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
522542
}
523543
end
524544
context 'default vhost defaults' do

spec/classes/dev_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
context "on a Debian OS" do
55
let :facts do
66
{
7+
:lsbdistcodename => 'squeeze',
78
:osfamily => 'Debian',
9+
:operatingsystem => 'Debian',
810
:operatingsystemrelease => '6',
911
}
1012
end
@@ -17,6 +19,7 @@
1719
let :facts do
1820
{
1921
:osfamily => 'RedHat',
22+
:operatingsystem => 'RedHat',
2023
:operatingsystemrelease => '6',
2124
}
2225
end
@@ -30,6 +33,7 @@
3033
let :facts do
3134
{
3235
:osfamily => 'FreeBSD',
36+
:operatingsystem => 'FreeBSD',
3337
:operatingsystemrelease => '9',
3438
}
3539
end

spec/classes/mod/auth_kerb_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
require 'spec_helper'
2+
13
describe 'apache::mod::auth_kerb', :type => :class do
24
let :pre_condition do
35
'include apache'
46
end
57
context "on a Debian OS", :compile do
68
let :facts do
79
{
10+
:id => 'root',
11+
:kernel => 'Linux',
12+
:lsbdistcodename => 'squeeze',
813
:osfamily => 'Debian',
14+
:operatingsystem => 'Debian',
915
:operatingsystemrelease => '6',
16+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
1017
:concat_basedir => '/dne',
1118
}
1219
end
@@ -17,8 +24,12 @@
1724
context "on a RedHat OS", :compile do
1825
let :facts do
1926
{
27+
:id => 'root',
28+
:kernel => 'Linux',
2029
:osfamily => 'RedHat',
30+
:operatingsystem => 'RedHat',
2131
:operatingsystemrelease => '6',
32+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
2233
:concat_basedir => '/dne',
2334
}
2435
end
@@ -29,8 +40,12 @@
2940
context "on a FreeBSD OS", :compile do
3041
let :facts do
3142
{
43+
:id => 'root',
44+
:kernel => 'FreeBSD',
3245
:osfamily => 'FreeBSD',
46+
:operatingsystem => 'FreeBSD',
3347
:operatingsystemrelease => '9',
48+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
3449
:concat_basedir => '/dne',
3550
}
3651
end

spec/classes/mod/authnz_ldap_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'spec_helper'
2+
13
describe 'apache::mod::authnz_ldap', :type => :class do
24
let :pre_condition do
35
'include apache'
@@ -6,9 +8,14 @@
68
context "on a Debian OS" do
79
let :facts do
810
{
11+
:lsbdistcodename => 'squeeze',
912
:osfamily => 'Debian',
1013
:operatingsystemrelease => '6',
1114
:concat_basedir => '/dne',
15+
:id => 'root',
16+
:kernel => 'Linux',
17+
:operatingsystem => 'Debian',
18+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
1219
}
1320
end
1421
it { should contain_class("apache::params") }
@@ -38,6 +45,10 @@
3845
:osfamily => 'RedHat',
3946
:operatingsystemrelease => '6',
4047
:concat_basedir => '/dne',
48+
:id => 'root',
49+
:kernel => 'Linux',
50+
:operatingsystem => 'RedHat',
51+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
4152
}
4253
end
4354
it { should contain_class("apache::params") }

0 commit comments

Comments
 (0)