1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Update: only "warn" when restart is required (#651)

* Fix: only "warn" when restart is required

Motivation: my logs are flooded with "warnings" when I run roles against instances.
So even though I understand for this "warning", it's a false positive when nothing
needs to be done.

* Update changelogs/fragments/651-fix-postgresql_set-warning.yaml

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Till! 2020-07-15 15:22:06 +02:00 committed by GitHub
parent c055340ecb
commit 8e45b96a33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,4 @@
---
bugfixes:
- postgresql_set - only display a warning about restarts, when
restarting is needed (https://github.com/ansible-collections/community.general/pull/651).

View file

@ -406,9 +406,6 @@ def main():
changed = param_set(cursor, module, name, boot_val, context)
if restart_required:
module.warn("Restart of PostgreSQL is required for setting %s" % name)
cursor.close()
db_connection.close()
@ -439,6 +436,10 @@ def main():
kw['changed'] = changed
kw['restart_required'] = restart_required
if restart_required and changed:
module.warn("Restart of PostgreSQL is required for setting %s" % name)
module.exit_json(**kw)