|
1516 | 1516 | )
|
1517 | 1517 | }
|
1518 | 1518 | end
|
| 1519 | + context 'vhost with scheme and port in servername and use_servername_for_filenames' do |
| 1520 | + let :params do |
| 1521 | + { |
| 1522 | + 'port' => '80', |
| 1523 | + 'ip' => '127.0.0.1', |
| 1524 | + 'ip_based' => true, |
| 1525 | + 'servername' => 'https://www.example.com:443', |
| 1526 | + 'docroot' => '/var/www/html', |
| 1527 | + 'add_listen' => true, |
| 1528 | + 'ensure' => 'present', |
| 1529 | + 'use_servername_for_filenames' => true |
| 1530 | + } |
| 1531 | + end |
| 1532 | + |
| 1533 | + it { is_expected.to compile } |
| 1534 | + it { |
| 1535 | + is_expected.to contain_concat__fragment('rspec.example.com-apache-header').with( |
| 1536 | + content: %r{^\s+ServerName https:\/\/www\.example\.com:443$}, |
| 1537 | + ) |
| 1538 | + } |
| 1539 | + it { |
| 1540 | + is_expected.to contain_concat('25-www.example.com.conf') |
| 1541 | + } |
| 1542 | + end |
| 1543 | + context 'vhost with scheme in servername and use_servername_for_filenames' do |
| 1544 | + let :params do |
| 1545 | + { |
| 1546 | + 'port' => '80', |
| 1547 | + 'ip' => '127.0.0.1', |
| 1548 | + 'ip_based' => true, |
| 1549 | + 'servername' => 'https://www.example.com', |
| 1550 | + 'docroot' => '/var/www/html', |
| 1551 | + 'add_listen' => true, |
| 1552 | + 'ensure' => 'present', |
| 1553 | + 'use_servername_for_filenames' => true |
| 1554 | + } |
| 1555 | + end |
| 1556 | + |
| 1557 | + it { is_expected.to compile } |
| 1558 | + it { |
| 1559 | + is_expected.to contain_concat__fragment('rspec.example.com-apache-header').with( |
| 1560 | + content: %r{^\s+ServerName https:\/\/www\.example\.com$}, |
| 1561 | + ) |
| 1562 | + } |
| 1563 | + it { |
| 1564 | + is_expected.to contain_concat('25-www.example.com.conf') |
| 1565 | + } |
| 1566 | + end |
| 1567 | + context 'vhost with port in servername and use_servername_for_filenames' do |
| 1568 | + let :params do |
| 1569 | + { |
| 1570 | + 'port' => '80', |
| 1571 | + 'ip' => '127.0.0.1', |
| 1572 | + 'ip_based' => true, |
| 1573 | + 'servername' => 'www.example.com:443', |
| 1574 | + 'docroot' => '/var/www/html', |
| 1575 | + 'add_listen' => true, |
| 1576 | + 'ensure' => 'present', |
| 1577 | + 'use_servername_for_filenames' => true |
| 1578 | + } |
| 1579 | + end |
| 1580 | + |
| 1581 | + it { is_expected.to compile } |
| 1582 | + it { |
| 1583 | + is_expected.to contain_concat__fragment('rspec.example.com-apache-header').with( |
| 1584 | + content: %r{^\s+ServerName www\.example\.com:443$}, |
| 1585 | + ) |
| 1586 | + } |
| 1587 | + it { |
| 1588 | + is_expected.to contain_concat('25-www.example.com.conf') |
| 1589 | + } |
| 1590 | + end |
| 1591 | + context 'vhost with servername and use_servername_for_filenames' do |
| 1592 | + let :params do |
| 1593 | + { |
| 1594 | + 'port' => '80', |
| 1595 | + 'ip' => '127.0.0.1', |
| 1596 | + 'ip_based' => true, |
| 1597 | + 'servername' => 'www.example.com', |
| 1598 | + 'docroot' => '/var/www/html', |
| 1599 | + 'add_listen' => true, |
| 1600 | + 'ensure' => 'present', |
| 1601 | + 'use_servername_for_filenames' => true |
| 1602 | + } |
| 1603 | + end |
| 1604 | + |
| 1605 | + it { is_expected.to compile } |
| 1606 | + it { |
| 1607 | + is_expected.to contain_concat__fragment('rspec.example.com-apache-header').with( |
| 1608 | + content: %r{^\s+ServerName www\.example\.com$}, |
| 1609 | + ) |
| 1610 | + } |
| 1611 | + it { |
| 1612 | + is_expected.to contain_concat('25-www.example.com.conf') |
| 1613 | + } |
| 1614 | + end |
1519 | 1615 | context 'vhost with multiple ip addresses' do
|
1520 | 1616 | let :params do
|
1521 | 1617 | {
|
|
0 commit comments