Skip to content

Instantly share code, notes, and snippets.

@bcoca
Created June 16, 2016 16:32
Show Gist options
  • Save bcoca/21ad0b9de41134927321feb95a330bc1 to your computer and use it in GitHub Desktop.
Save bcoca/21ad0b9de41134927321feb95a330bc1 to your computer and use it in GitHub Desktop.
diff --git a/database/postgresql/postgresql_ext.py b/database/postgresql/postgresql_ext.py
index d307963..0056168 100644
--- a/database/postgresql/postgresql_ext.py
+++ b/database/postgresql/postgresql_ext.py
@@ -168,19 +168,18 @@ def main():
changed = not ext_exists(cursor, ext)
elif state == "present":
changed = ext_exists(cursor, ext)
- module.exit_json(changed=changed,ext=ext)
-
- if state == "absent":
- changed = ext_delete(cursor, ext)
+ else:
+ if state == "absent":
+ changed = ext_delete(cursor, ext)
- elif state == "present":
- changed = ext_create(cursor, ext)
+ elif state == "present":
+ changed = ext_create(cursor, ext)
except NotSupportedError, e:
module.fail_json(msg=str(e))
except Exception, e:
module.fail_json(msg="Database query failed: %s" % e)
- module.exit_json(changed=changed, db=db)
+ module.exit_json(changed=changed, db=db, ext=ext)
# import module snippets
from ansible.module_utils.basic import *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment