From 9509224768de3d92a2abaddd75fa55e24eaaee78 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Wed, 21 Sep 2016 20:14:03 +0300 Subject: [PATCH] postgresql_db: fix inverted 'changed' logic when state=absent (#4934) Fixes #4933. --- lib/ansible/modules/database/postgresql/postgresql_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 lib/ansible/modules/database/postgresql/postgresql_db.py diff --git a/lib/ansible/modules/database/postgresql/postgresql_db.py b/lib/ansible/modules/database/postgresql/postgresql_db.py old mode 100644 new mode 100755 index 33e812bc560..64871ed1734 --- a/lib/ansible/modules/database/postgresql/postgresql_db.py +++ b/lib/ansible/modules/database/postgresql/postgresql_db.py @@ -288,11 +288,11 @@ def main(): try: if module.check_mode: if state == "absent": - changed = not db_exists(cursor, db) + changed = db_exists(cursor, db) elif state == "present": changed = not db_matches(cursor, db, owner, template, encoding, lc_collate, lc_ctype) - module.exit_json(changed=changed,db=db) + module.exit_json(changed=changed, db=db) if state == "absent": try: