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:
parent
c055340ecb
commit
8e45b96a33
2 changed files with 8 additions and 3 deletions
4
changelogs/fragments/651-fix-postgresql_set-warning.yaml
Normal file
4
changelogs/fragments/651-fix-postgresql_set-warning.yaml
Normal 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).
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue