Skip to content

An Array of $listen_addresses doesn't work #1658

@arjenz

Description

@arjenz

Describe the Bug

$listen_addresses doesn't work for Arrays

Expected Behavior

If I specify $listen_addresses as an Array of IPs, I expect them to show up in the postgresql config, but only the first one shows up.
REFERENCE.md:


listen_addresses

Data type: Optional[Variant[String[1], Array[String[1]]]]

Address list on which the PostgreSQL service will listen

Steps to Reproduce

Steps to reproduce the behavior:

class { '::postgresql::server':
  listen_addresses => [ $facts['networking']['ip'], '127.0.0.1'],
}
# grep 127.0.0.1 postgresql.conf
# grep $(puppet facts networking.ip | jq -r .[]) postgresql.conf
listen_addresses = '192.168.104.11'
#

Environment

  • 10.6.1 and older, also main
  • Tested on Ubuntu 24.04, 22.04.

Additional Context

class { '::postgresql::server':
  listen_addresses => [ $facts['networking']['ip'], '127.0.0.1' ].join(','),
}
# grep 127.0.0.1 postgresql.conf
listen_addresses = '192.168.104.12,127.0.0.1'
#

as a workaround works. There is some sanity checking, but this escapes that checking luckily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions