Created
January 31, 2018 14:45
-
-
Save magicrobotmonkey/268520c8293fc8e53f87fd2f645232c1 to your computer and use it in GitHub Desktop.
ansible and postgres starting and stopping
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
# handy for waiting for postgres to restore/catch up to master | |
- name: wait for db to come up | |
shell: until /usr/bin/pg_isready; do sleep 1; done | |
args: | |
executable: /bin/bash | |
changed_when: false | |
delegate_to: "{{ database_host }}" | |
become_user: postgres | |
run_once: true | |
# handy when waiting for postgres to shutdown so you can restore a wal-e backup | |
- name: wait for db to stop | |
shell: while /usr/bin/pg_isready; do sleep 1; done | |
args: | |
executable: /bin/bash | |
changed_when: false | |
delegate_to: "{{ database_host }}" | |
become_user: postgres | |
run_once: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment