Created
September 12, 2016 18:00
-
-
Save zevarito/71caa3a0b1a4d79acec7b2355a6695b5 to your computer and use it in GitHub Desktop.
Ansible task to ensure which containers should be running
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
# Check which containers should be running | |
- name: fail if container not running | |
command: "docker inspect --format='{% raw %}{{.State.Status}}{% endraw %}' {{ item }}" | |
register: command_result | |
failed_when: command_result.stdout != 'running' | |
ignore_errors: True | |
with_items: | |
- api | |
- web | |
- postgres | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment