File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 17221722# value of the $servername parameter.
17231723# When set to false (default), the existing behaviour of using the $name parameter
17241724# will remain.
1725+ #
1726+ # @param $mdomain
1727+ # All the names in the list are managed as one Managed Domain (MD). mod_md will request
1728+ # one single certificate that is valid for all these names.
17251729
17261730define apache::vhost (
17271731 Variant[Boolean,String] $docroot ,
19711975 Hash $define = {},
19721976 Boolean $auth_oidc = false ,
19731977 Optional[Apache::OIDCSettings] $oidc_settings = undef ,
1978+ Optional[Variant[Boolean,String]] $mdomain = undef ,
19741979) {
19751980 # The base class must be included first because it is used by parameter defaults
19761981 if ! defined (Class[' apache' ]) {
27712776 }
27722777 }
27732778
2779+ if $mdomain {
2780+ include apache::mod::md
2781+ }
2782+
27742783 # Template uses:
27752784 # - $passenger_enabled
27762785 # - $passenger_start_timeout
Original file line number Diff line number Diff line change 484484 'RemoteUserClaim' => 'sub' ,
485485 'ClientSecret' => 'aae053a9-4abf-4824-8956-e94b2af335c8' ,
486486 'CryptoPassphrase' => '4ad1bb46-9979-450e-ae58-c696967df3cd' } ,
487+ 'mdomain' => 'example.com example.net auto' ,
487488 }
488489 end
489490
14831484 content : %r{^\s +OIDCCryptoPassphrase\s 4ad1bb46-9979-450e-ae58-c696967df3cd$} ,
14841485 )
14851486 }
1487+ it { is_expected . to contain_class ( 'apache::mod::md' ) }
1488+ it {
1489+ is_expected . to contain_concat__fragment ( 'rspec.example.com-apache-header' ) . with (
1490+ content : %r{^MDomain example\. com example\. net auto$} ,
1491+ )
1492+ }
14861493 end
14871494 context 'vhost with multiple ip addresses' do
14881495 let :params do
24512458 it { is_expected . not_to compile }
24522459 end
24532460 end
2461+ context 'mdomain' do
2462+ let :params do
2463+ default_params . merge (
2464+ 'mdomain' => true ,
2465+ )
2466+ end
2467+
2468+ it {
2469+ is_expected . to contain_concat__fragment ( 'rspec.example.com-apache-header' ) . with (
2470+ content : %r{^MDomain rspec.example.com$} ,
2471+ )
2472+ }
2473+ end
24542474 end
24552475 end
24562476 end
Original file line number Diff line number Diff line change 33# Managed by Puppet
44# ************************************
55<%= [@comment].flatten.collect{|c| "# #{c}"}.join("\n") -%>
6+ <% if @mdomain -%>
7+
8+ <%- if @mdomain.is_a?(String) -%>
9+ MDomain <%= @mdomain %>
10+ <%- else -%>
11+ MDomain <%= @servername %>
12+ <%- end -%>
13+ <% end -%>
614
715 <VirtualHost <%= [ @nvh_addr_port ] . flatten . compact . join ( ' ' ) %> >
816<% @define . each do | k , v | -%>
Original file line number Diff line number Diff line change 22
33 ## SSL directives
44 SSLEngine on
5+ <%- unless @mdomain -%>
56 SSLCertificateFile "<%= @ssl_cert %> "
67 SSLCertificateKeyFile "<%= @ssl_key %> "
8+ <%- end -%>
79 <%- if @ssl_chain -%>
810 SSLCertificateChainFile "<%= @ssl_chain %> "
911 <%- end -%>
You can’t perform that action at this time.
0 commit comments