Skip to content

serveraliases template creation fails on String #2517

Closed
@jdreffein

Description

@jdreffein

Describe the Bug

If parameter serveraliases for a vhost is defined as a string instead of an array, the resulting entries in the vhost config file consist of each character of that string.
If the string contains a wildcard it turns into a unwanted catchall vhost for some other vhosts.
The example below results in something like this:
## Server aliases
ServerAlias *
ServerAlias .
ServerAlias s
ServerAlias t
ServerAlias r
ServerAlias i
ServerAlias n
ServerAlias g
ServerAlias .
ServerAlias c
ServerAlias o
ServerAlias m

This bug was introduced with 12.0.0 and worked as expected until 11.1.0

Expected Behavior

the config files should remain untouched after an upgrade from 11.1.0 to 12.0.0 or 12.0.1
in this case:
## Server aliases
ServerAlias *.string.com

Steps to Reproduce

Steps to reproduce the behavior:
create a vhost like this:
apache::vhost { 'string.com':
servername => 'string.com',
serveraliases => '*.string.com',
}

run puppet on host, look in the resulting conf file.

Workaround

change parameter to array:
serveraliases => ['*.string.com'],

Environment

  • Version 12.0.0 / 12.0.1
  • Puppet Version 7.27.0
  • Platform OracleLinux 7

Additional Context

refs:
https://forge.puppet.com/modules/puppetlabs/apache/reference#-apache--vhost--serveraliases
serveraliases
Data type: Variant[Array[String], String]
Sets the ServerAliases of the site.
Default value: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions