---
# handlers file for marathon
# Restart service marathon, in all cases
- name: Restart marathon
  sudo: yes
  service:
    name: marathon
    state: restarted

---
# handlers file for marathon
# Restart service marathon, in all cases
- name: Restart marathon
  sudo: yes
  service:
    name: marathon
    state: restarted
  notify:
    - wait for marathon to listen

- name: wait for marathon to listen
  sudo: yes
  command: "curl -s http://localhost:{{ marathon_port }}/ping"
  register: log_output
  until: log_output.stdout.find("pong") > -1
  retries: 10
  delay: 3
Add a wait for marathon to be able to be pinged
Add a wait for marathon to be able to be pinged
