You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-12 23:02:47 +03: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:
@@ -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)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user