-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgresql_set on log_rotation_size reports change with --check mode #732
Comments
Thanks for the report @eb4x ! |
@eb4x is this something you might feel like tackling yourself? if not, that's OK; someone will pick it up. if so, a couple of (probably obvious) things worth mentioning:
thanks! |
I've had a look at this and I think it effects at least all settings that have a unit of I think the bug is here:
In the example given above this check ends up being: if pretty_to_bytes('10240') == pretty_to_bytes('10MB'): which evaluates to I can try to fix this, but am unsure how much time I will have over the next few days. |
@cameronmurdoch please go ahead and thanks! i've assigned it to you. If the circumstances change, please let us know |
@Andersson007 another part of this bug is that for this case (the setting has a unit but is supplied without units) the return value of For example, using the values from above and no check mode we get: "changed": false,
"name": "log_rotation_size",
"prev_val_pretty": "10MB",
"value_pretty": "10MB" But with check mode we get: "changed": true,
"name": "log_rotation_size",
"prev_val_pretty": "10MB",
"value_pretty": "10240" The doc says that How important do you think is it that this bit of the problem is also fixed? I would have thought that being consistent between check mode and normal mode is better? Edit: I've also researched this bug a bit more and it seems to affect all settings that have units of BLOCKSIZE,kB,MB,min,s, and ms. |
@cameronmurdoch yes, consistent work would be great |
Which file should new integration tests go in? |
@cameronmurdoch in this case, i think, yes |
@Andersson007 That's great, but which of the two files? :-) |
Oh, sorry, i saw only one somehow, now i see both - use any:) |
SUMMARY
The
postgresql_set
reports a change tolog_rotation_size
when running in--check
mode.ISSUE TYPE
COMPONENT NAME
community.postgresql.postgresql_set
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Target: AlmaLinux 8.10 (Cerulean Leopard)
STEPS TO REPRODUCE
Run a playbook to set the
log_rotation_size
for your postgresql server, then run the same playbook with--check
to see if it needs to change anything.I.e.
It'll report back it's gonna change the value. But if you run it without the check, there's no change reported.
EXPECTED RESULTS
No change reported during
--check
mode.ACTUAL RESULTS
It reports back a change is needed.
I don't know how many other options are affected by this, but of all the changes I set here, only
log_rotation_size
reports back a need for change.The text was updated successfully, but these errors were encountered: