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