Skip to content

Commit

Permalink
Only warn about servername logging if relevant
Browse files Browse the repository at this point in the history
The warning about $use_servername_for_filenames is long and may not
affect users. If they use a normal $name, there would effectively be no
difference. This compares $name to $normalized_servername. The warning
is only relevant Only if they differ.

Technically there could be a space in $servername (since there is no
data type to enforce validation) but Apache wouldn't accept that anyway.

It also fixes two typos in the warnings.
  • Loading branch information
ekohl committed Jun 15, 2021
1 parent 958023b commit 6a37b36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,15 +2111,15 @@
false => $name,
}

if ! $use_servername_for_filenames {
if ! $use_servername_for_filenames and $name != $normalized_servername {
$use_servername_for_filenames_warn_msg = '
It is possible for the $name parameter to be defined with spaces in it. Although supported on POSIX systems, this
can lead to cumbersome file names. The $servername attribute has stricter conditions from Apache (i.e. no spaces)
When $use_servername_for_filenames = true, the $servername parameter, sanitized, is used to construct log and config
file names.
From version v7.0.0 of the puppetlabs-apache module, this parameter will default to true. From version v8.0.0 of the
module, the $use_servername_for_filenames will be removed and log/config file names will be dervied from the
module, the $use_servername_for_filenames will be removed and log/config file names will be derived from the
sanitized $servername parameter when not explicitly defined.'
warning($use_servername_for_filenames_warn_msg)
} elsif ! $use_port_for_filenames {
Expand All @@ -2130,7 +2130,7 @@
config file names.
From version v7.0.0 of the puppetlabs-apache module, this parameter will default to true. From version v8.0.0 of the
module, the $use_port_for_filenames will be removed and log/config file names will be dervied from the
module, the $use_port_for_filenames will be removed and log/config file names will be derived from the
sanitized $servername parameter when not explicitly defined.'
warning($use_port_for_filenames_warn_msg)
}
Expand Down

0 comments on commit 6a37b36

Please sign in to comment.