|
1269 | 1269 | 'manage_docroot' => true,
|
1270 | 1270 | 'logroot' => '/tmp/logroot',
|
1271 | 1271 | '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 | 1272 | }
|
1290 | 1273 | end
|
1291 | 1274 |
|
|
1318 | 1301 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-itk') }
|
1319 | 1302 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-fallbackresource') }
|
1320 | 1303 | 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 | 1304 | it { is_expected.not_to contain_concat__fragment('rspec.example.com-additional_includes') }
|
1339 | 1305 | it { is_expected.to contain_concat__fragment('rspec.example.com-logging') }
|
1340 | 1306 | it { is_expected.to contain_concat__fragment('rspec.example.com-serversignature') }
|
|
1761 | 1727 | it { is_expected.to contain_concat__fragment('rspec.example.com-directories') }
|
1762 | 1728 | end
|
1763 | 1729 | end
|
| 1730 | + |
| 1731 | + # the following style is only present on Apache 2.2 |
| 1732 | + # That is used in SLES 11, RHEL6, Amazon Linux |
| 1733 | + if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 7) || |
| 1734 | + (facts[:os]['name'] == 'Amazon') || |
| 1735 | + (facts[:os]['name'] == 'SLES' && facts[:os]['release']['major'].to_i < 12) |
| 1736 | + context 'apache 2.2 access controls on directories' do |
| 1737 | + let :params do |
| 1738 | + { |
| 1739 | + 'docroot' => '/var/www/foo', |
| 1740 | + 'directories' => [ |
| 1741 | + { |
| 1742 | + 'path' => '/var/www/foo', |
| 1743 | + 'provider' => 'files', |
| 1744 | + 'allow' => 'from 127.0.0.5', |
| 1745 | + 'deny' => 'from all', |
| 1746 | + 'order' => 'deny,allow', |
| 1747 | + }, |
| 1748 | + { |
| 1749 | + 'path' => '/var/www/protected-files', |
| 1750 | + 'provider' => 'files', |
| 1751 | + 'allow' => ['from 127.0.0.1', 'from 127.0.0.2'], |
| 1752 | + 'deny' => ['from 127.0.0.3', 'from 127.0.0.4'], |
| 1753 | + 'satisfy' => 'any', |
| 1754 | + }, |
| 1755 | + ], |
| 1756 | + } |
| 1757 | + end |
| 1758 | + |
| 1759 | + it { is_expected.to compile } |
| 1760 | + it { is_expected.to contain_concat('25-rspec.example.com.conf') } |
| 1761 | + it { |
| 1762 | + is_expected.to contain_concat__fragment('rspec.example.com-directories') |
| 1763 | + .with_content(%r{^\s+Allow from 127\.0\.0\.1$}) |
| 1764 | + .with_content(%r{^\s+Allow from 127\.0\.0\.2$}) |
| 1765 | + .with_content(%r{^\s+Allow from 127\.0\.0\.5$}) |
| 1766 | + .with_content(%r{^\s+Deny from 127\.0\.0\.3$}) |
| 1767 | + .with_content(%r{^\s+Deny from 127\.0\.0\.4$}) |
| 1768 | + .with_content(%r{^\s+Deny from all$}) |
| 1769 | + .with_content(%r{^\s+Satisfy any$}) |
| 1770 | + .with_content(%r{^\s+Order deny,allow$}) |
| 1771 | + } |
| 1772 | + end |
| 1773 | + end |
| 1774 | + |
1764 | 1775 | context 'require unmanaged' do
|
1765 | 1776 | let :params do
|
1766 | 1777 | {
|
|
0 commit comments