|
171 | 171 | 'set_output_filter' => 'output_filter' },
|
172 | 172 | { 'path' => '/var/www/files/input_filtered',
|
173 | 173 | 'set_input_filter' => 'input_filter' },
|
| 174 | + { |
| 175 | + 'path' => '/var/www/foo', |
| 176 | + 'provider' => 'files', |
| 177 | + 'allow' => 'from 127.0.0.5', |
| 178 | + 'deny' => 'from all', |
| 179 | + 'order' => 'deny,allow', |
| 180 | + }, |
| 181 | + { |
| 182 | + 'path' => '/var/www/protected-files', |
| 183 | + 'provider' => 'files', |
| 184 | + 'allow' => ['from 127.0.0.1', 'from 127.0.0.2'], |
| 185 | + 'deny' => ['from 127.0.0.3', 'from 127.0.0.4'], |
| 186 | + 'satisfy' => 'any', |
| 187 | + }, |
174 | 188 | { 'path' => '/var/www/files',
|
175 | 189 | 'provider' => 'location',
|
176 | 190 | 'limit' => [
|
|
617 | 631 | }
|
618 | 632 | it { is_expected.to contain_concat__fragment('rspec.example.com-itk') }
|
619 | 633 | it { is_expected.to contain_concat__fragment('rspec.example.com-fallbackresource') }
|
| 634 | + |
620 | 635 | it {
|
621 | 636 | is_expected.to contain_concat__fragment('rspec.example.com-directories')
|
622 | 637 | .with_content(%r{^\s+<Proxy "\*">$})
|
|
726 | 741 | .with_content(%r{^\s+SSLVerifyClient\soptional$})
|
727 | 742 | .with_content(%r{^\s+SSLVerifyDepth\s10$})
|
728 | 743 | }
|
| 744 | + # the following style is only present on Apache 2.2 |
| 745 | + # That is used in SLES 11, RHEL6, Amazon Linux |
| 746 | + if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 7) || |
| 747 | + (facts[:os]['name'] == 'Amazon') || |
| 748 | + (facts[:os]['name'] == 'SLES' && facts[:os]['release']['major'].to_i < 12) |
| 749 | + it { |
| 750 | + is_expected.to contain_concat__fragment('rspec.example.com-directories') |
| 751 | + .with_content(%r{^\s+Allow from 127\.0\.0\.1$}) |
| 752 | + .with_content(%r{^\s+Allow from 127\.0\.0\.2$}) |
| 753 | + .with_content(%r{^\s+Allow from 127\.0\.0\.5$}) |
| 754 | + .with_content(%r{^\s+Deny from 127\.0\.0\.3$}) |
| 755 | + .with_content(%r{^\s+Deny from 127\.0\.0\.4$}) |
| 756 | + .with_content(%r{^\s+Deny from all$}) |
| 757 | + .with_content(%r{^\s+Satisfy any$}) |
| 758 | + .with_content(%r{^\s+Order deny,allow$}) |
| 759 | + } |
| 760 | + end |
| 761 | + |
729 | 762 | it { is_expected.to contain_concat__fragment('rspec.example.com-additional_includes') }
|
730 | 763 | it {
|
731 | 764 | is_expected.to contain_concat__fragment('rspec.example.com-logging')
|
|
1269 | 1302 | 'manage_docroot' => true,
|
1270 | 1303 | 'logroot' => '/tmp/logroot',
|
1271 | 1304 | 'logroot_ensure' => 'absent',
|
1272 |
| - 'directories' => [ |
1273 |
| - { |
1274 |
| - 'path' => '/var/www/files', |
1275 |
| - 'provider' => 'files', |
1276 |
| - 'allow' => ['from 127.0.0.1', 'from 127.0.0.2'], |
1277 |
| - 'deny' => ['from 127.0.0.3', 'from 127.0.0.4'], |
1278 |
| - 'satisfy' => 'any', |
1279 |
| - }, |
1280 |
| - { |
1281 |
| - 'path' => '/var/www/foo', |
1282 |
| - 'provider' => 'files', |
1283 |
| - 'allow' => 'from 127.0.0.5', |
1284 |
| - 'deny' => 'from all', |
1285 |
| - 'order' => 'deny,allow', |
1286 |
| - }, |
1287 |
| - ], |
1288 |
| - |
1289 | 1305 | }
|
1290 | 1306 | end
|
1291 | 1307 |
|
|
1318 | 1334 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-itk') }
|
1319 | 1335 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-fallbackresource') }
|
1320 | 1336 | it { is_expected.to contain_concat__fragment('rspec.example.com-directories') }
|
1321 |
| - # the following style is only present on Apache 2.2 |
1322 |
| - # That is used in SLES 11, RHEL6, Amazon Linux |
1323 |
| - if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 7) || |
1324 |
| - (facts[:os]['name'] == 'Amazon') || |
1325 |
| - (facts[:os]['name'] == 'SLES' && facts[:os]['release']['major'].to_i < 12) |
1326 |
| - it { |
1327 |
| - is_expected.to contain_concat__fragment('rspec.example.com-directories') |
1328 |
| - .with_content(%r{^\s+Allow from 127\.0\.0\.1$}) |
1329 |
| - .with_content(%r{^\s+Allow from 127\.0\.0\.2$}) |
1330 |
| - .with_content(%r{^\s+Allow from 127\.0\.0\.5$}) |
1331 |
| - .with_content(%r{^\s+Deny from 127\.0\.0\.3$}) |
1332 |
| - .with_content(%r{^\s+Deny from 127\.0\.0\.4$}) |
1333 |
| - .with_content(%r{^\s+Deny from all$}) |
1334 |
| - .with_content(%r{^\s+Satisfy any$}) |
1335 |
| - .with_content(%r{^\s+Order deny,allow$}) |
1336 |
| - } |
1337 |
| - end |
1338 | 1337 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-additional_includes') }
|
1339 | 1338 | it { is_expected.to contain_concat__fragment('rspec.example.com-logging') }
|
1340 | 1339 | it { is_expected.to contain_concat__fragment('rspec.example.com-serversignature') }
|
|
0 commit comments