Describe the Bug
When setting postgresql::server::config_entry resources to ensure => absent, the provider incorrectly requires the provided value to either match the one currently in postgresql.yml or be empty (undef, or anything that renders as an empty string).
The confusing behavior is that if the value provided does not match what's in postgresql.yml, Puppet will output that it's removing the configuration, but the entry remains in the file. As a result, every subsequent run repeats the same “removal” message, creating an endless loop of false reporting.
Expected Behavior
When ensure is set to absent, the provider should just completely ignore the value field.
Steps to Reproduce
Steps to reproduce the behavior:
- Have a this module properly setup and already running and managing a postgres instance
This is a sample site.pp
class { 'postgresql::globals':
manage_package_repo => true,
version => '16',
}
class { 'postgresql::server': }
- Define a
postgresql::server::config_entry resource in your site.pp. For example, initially set log_rotation_size to 45MB.
postgresql::server::config_entry { 'log_rotation_size':
value => '45MB',
}
- Run
puppet agent -t and check that postgresql.yml contains the correct value
postgresql::server::config_entry { 'log_rotation_size':
ensure => absent,
value => '50MB',
}
- Add
ensure => absent, and change the value to 50MB
- Run
puppet agent -t. There should be a notice that log_rotation_size was removed ✅
- Check
postgresql.yml for log_rotation_size and be amazed it's still there 🥹
- Repeat the last 2 steps and go insane
pp_postgresql_conif_entries_bug.log
Environment
- Version v10.6.1
- Platform [e.g. Ubuntu 24.04]
Additional Context
Add any other context about the problem here.
Describe the Bug
When setting
postgresql::server::config_entryresources toensure => absent, the provider incorrectly requires the provided value to either match the one currently inpostgresql.ymlor be empty (undef, or anything that renders as an empty string).The confusing behavior is that if the value provided does not match what's in
postgresql.yml, Puppet will output that it's removing the configuration, but the entry remains in the file. As a result, every subsequent run repeats the same “removal” message, creating an endless loop of false reporting.Expected Behavior
When ensure is set to
absent, the provider should just completely ignore thevaluefield.Steps to Reproduce
Steps to reproduce the behavior:
This is a sample
site.pppostgresql::server::config_entryresource in yoursite.pp. For example, initially setlog_rotation_sizeto45MB.puppet agent -tand check thatpostgresql.ymlcontains the correct valueensure => absent,and change the value to50MBpuppet agent -t. There should be a notice thatlog_rotation_sizewas removed ✅postgresql.ymlforlog_rotation_sizeand be amazed it's still there 🥹pp_postgresql_conif_entries_bug.log
Environment
Additional Context
Add any other context about the problem here.