|
86 | 86 | # Pre-generated SSL Certificate file to reference for SSL Support. This is |
87 | 87 | # not generated by this module. Set to `false` to inherit from the http |
88 | 88 | # section, which improves performance by conserving memory. |
| 89 | +# Use an array to add multiple SSL Certificates. |
89 | 90 | # @param ssl_client_cert |
90 | 91 | # Pre-generated SSL Certificate file to reference for client verify SSL |
91 | 92 | # Support. This is not generated by this module. |
|
111 | 112 | # Pre-generated SSL Key file to reference for SSL Support. This is not |
112 | 113 | # generated by this module. Set to `false` to inherit from the http section, |
113 | 114 | # which improves performance by conserving memory. |
| 115 | +# Use an array to add multiple SSL Keys. |
114 | 116 | # @param ssl_port |
115 | 117 | # Default IP Port for NGINX to listen with this SSL server on. |
116 | 118 | # @param ssl_protocols |
|
294 | 296 | Hash $add_header = {}, |
295 | 297 | Boolean $ssl = false, |
296 | 298 | Boolean $ssl_listen_option = true, |
297 | | - Optional[Variant[String, Boolean]] $ssl_cert = undef, |
| 299 | + Optional[Variant[String, Boolean, Array[String]]] $ssl_cert = undef, |
298 | 300 | Optional[String] $ssl_client_cert = undef, |
299 | 301 | String $ssl_verify_client = 'on', |
300 | 302 | Optional[String] $ssl_dhparam = undef, |
301 | 303 | Optional[String] $ssl_ecdh_curve = undef, |
302 | 304 | Boolean $ssl_redirect = false, |
303 | 305 | Optional[Integer] $ssl_redirect_port = undef, |
304 | | - Optional[Variant[String, Boolean]] $ssl_key = undef, |
| 306 | + Optional[Variant[String, Boolean, Array[String]]] $ssl_key = undef, |
305 | 307 | Integer $ssl_port = 443, |
306 | 308 | Optional[Enum['on', 'off']] $ssl_prefer_server_ciphers = undef, |
307 | 309 | Optional[String] $ssl_protocols = undef, |
|
592 | 594 | if $ssl { |
593 | 595 | # Access and error logs are named differently in ssl template |
594 | 596 |
|
595 | | - File <| title == $ssl_cert or path == $ssl_cert or title == $ssl_key or path == $ssl_key |> |
596 | | - -> concat::fragment { "${name_sanitized}-ssl-header": |
| 597 | + if $ssl_key { |
| 598 | + $ssl_key_real = $ssl_key.flatten |
| 599 | + $ssl_key_real.each | $key | { |
| 600 | + File <| title == $key or path == $key |> { |
| 601 | + before => Concat::Fragment["${name_sanitized}-ssl-header"], |
| 602 | + } |
| 603 | + } |
| 604 | + } |
| 605 | + if $ssl_cert { |
| 606 | + $ssl_cert_real = $ssl_cert.flatten |
| 607 | + $ssl_cert_real.each | $cert | { |
| 608 | + File <| title == $cert or path == $cert |> { |
| 609 | + before => Concat::Fragment["${name_sanitized}-ssl-header"], |
| 610 | + } |
| 611 | + } |
| 612 | + } |
| 613 | + concat::fragment { "${name_sanitized}-ssl-header": |
597 | 614 | target => $config_file, |
598 | 615 | content => template('nginx/server/server_ssl_header.erb'), |
599 | 616 | order => '700', |
|
0 commit comments