summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2016-09-21 20:14:03 +0300
committerRene Moser <mail@renemoser.net>2016-09-21 20:26:23 +0200
commit258e6d60c87dd69cc11cb89f256813f864ba7986 (patch)
treeb90b81f2e9e52ce09e2ad64bc350689c42135164
parent072e89637c3a0963aa99fcaf63145603ee48eadd (diff)
downloadansible-modules-core-258e6d60c87dd69cc11cb89f256813f864ba7986.tar.gz
postgresql_db: fix inverted 'changed' logic when state=absent (#4934)
Fixes #4933.
-rwxr-xr-x[-rw-r--r--]database/postgresql/postgresql_db.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/database/postgresql/postgresql_db.py b/database/postgresql/postgresql_db.py
index cca41963..75d47f59 100644..100755
--- a/database/postgresql/postgresql_db.py
+++ b/database/postgresql/postgresql_db.py
@@ -286,11 +286,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: