Skip to content

Instantly share code, notes, and snippets.

@zevarito
Created September 12, 2016 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zevarito/71caa3a0b1a4d79acec7b2355a6695b5 to your computer and use it in GitHub Desktop.
Save zevarito/71caa3a0b1a4d79acec7b2355a6695b5 to your computer and use it in GitHub Desktop.
Ansible task to ensure which containers should be running
# 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