Created
June 16, 2016 16:32
-
-
Save bcoca/21ad0b9de41134927321feb95a330bc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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