Created
June 10, 2014 18:11
-
-
Save maxim/ab56347451e11bc86161 to your computer and use it in GitHub Desktop.
ansible task for ensuring postgresql extension exists without skipping or perpetual "changed"
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
- name: ensure postgresql hstore extension is created | |
sudo: yes | |
sudo_user: postgres | |
shell: "psql {{ postgresql_database }} -c 'CREATE EXTENSION hstore;'" | |
register: psql_result | |
failed_when: > | |
psql_result.rc != 0 and ("already exists" not in psql_result.stderr) | |
changed_when: "psql_result.rc == 0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment