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 1722
1722
# value of the $servername parameter.
1723
1723
# When set to false (default), the existing behaviour of using the $name parameter
1724
1724
# 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.
1725
1729
1726
1730
define apache::vhost (
1727
1731
Variant[Boolean,String] $docroot ,
1971
1975
Hash $define = {},
1972
1976
Boolean $auth_oidc = false ,
1973
1977
Optional[Apache::OIDCSettings] $oidc_settings = undef ,
1978
+ Optional[Variant[Boolean,String]] $mdomain = undef ,
1974
1979
) {
1975
1980
# The base class must be included first because it is used by parameter defaults
1976
1981
if ! defined (Class[' apache' ]) {
2771
2776
}
2772
2777
}
2773
2778
2779
+ if $mdomain {
2780
+ include apache::mod::md
2781
+ }
2782
+
2774
2783
# Template uses:
2775
2784
# - $passenger_enabled
2776
2785
# - $passenger_start_timeout
Original file line number Diff line number Diff line change 484
484
'RemoteUserClaim' => 'sub' ,
485
485
'ClientSecret' => 'aae053a9-4abf-4824-8956-e94b2af335c8' ,
486
486
'CryptoPassphrase' => '4ad1bb46-9979-450e-ae58-c696967df3cd' } ,
487
+ 'mdomain' => 'example.com example.net auto' ,
487
488
}
488
489
end
489
490
1483
1484
content : %r{^\s +OIDCCryptoPassphrase\s 4ad1bb46-9979-450e-ae58-c696967df3cd$} ,
1484
1485
)
1485
1486
}
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
+ }
1486
1493
end
1487
1494
context 'vhost with multiple ip addresses' do
1488
1495
let :params do
2451
2458
it { is_expected . not_to compile }
2452
2459
end
2453
2460
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
2454
2474
end
2455
2475
end
2456
2476
end
Original file line number Diff line number Diff line change 3
3
# Managed by Puppet
4
4
# ************************************
5
5
<%= [@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 -%>
6
14
7
15
<VirtualHost <%= [ @nvh_addr_port ] . flatten . compact . join ( ' ' ) %> >
8
16
<% @define . each do | k , v | -%>
Original file line number Diff line number Diff line change 2
2
3
3
## SSL directives
4
4
SSLEngine on
5
+ <%- unless @mdomain -%>
5
6
SSLCertificateFile "<%= @ssl_cert %> "
6
7
SSLCertificateKeyFile "<%= @ssl_key %> "
8
+ <%- end -%>
7
9
<%- if @ssl_chain -%>
8
10
SSLCertificateChainFile "<%= @ssl_chain %> "
9
11
<%- end -%>
You can’t perform that action at this time.
0 commit comments