puppetlabs / puppetlabs/puppetlabs-postgresql
An Array of `$listen_addresses` doesn't work
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 232
- Forks
- 610
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect REFERENCE.md and the configuration path used by class { '::postgresql::server' } to trace how array values reach postgresql.conf. Reproduce the two-address example and confirm that the completed change emits both addresses while preserving the existing sanity checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, ruby
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100