diff --git a/manifests/named_vhost.pp b/manifests/named_vhost.pp index 87589777e7922d649286d3985d50840a30419a6f..4b0899903fe5f242eaabe43bea82a6bf9ef37cb1 100644 --- a/manifests/named_vhost.pp +++ b/manifests/named_vhost.pp @@ -10,12 +10,17 @@ * - urls * Specifies one or more addresses that this virtual host handles, i.e. * which 'Listen' directives apply to it, on the format of URLs, in the - * same format as apache::listen does. apache::listen will be called - * automatically, so you don't need to do that separately (this is a new - * behaviour since 2024). + * same format as apache::listen does. apache::listen will by default + * be called automatically, so you don't need to do that separately + * (this is a new behaviour since 2024). * This parameter can be either a single URL, or a (possibly nested) * list of URLs. * + * - listen + * URLs to listen to, using apache::listen. This will use the value of + * the 'urls' parameter as its default value. Specify the empty list if + * you do not want to generate any Listen directives automatically. + * * - servernames * Which hostnames in URLs this virtual host applies to. Translates * into 'ServerName' and 'ServerAlias' directives. Defaults to the @@ -50,6 +55,7 @@ # e.g. http over https. define apache::named_vhost($urls, + $listen=undef, $servernames=[], $certname=false, $documentroot='', @@ -69,7 +75,7 @@ define apache::named_vhost($urls, } apache::listen { "_vhost-${name}": - urls => $urls; + urls => $listen ? { undef => $urls, default => $listen }; } apache::include_file { "vhost-${name}":