---

- hosts: localhost
  connection: local
  sudo: yes
  
  tasks:
    - name: Wait for Marathon to be up
      wait_for: host="{{ansible_default_ipv4.address}}" port=8080 state=started delay=3 timeout=5
    
    - name: Test for Marathon ... endpoint
      get_url: 
        url="http://{{ansible_default_ipv4.address}}:8080/v2/info" 
        dest=/tmp/marathon-info
        force=yes
      register: status
      failed_when: "'OK' not in status.msg"


---

- hosts: localhost
  connection: local
  sudo: yes
  
  tasks:
    - name: Wait for Marathon to be up
      wait_for: host="{{ansible_default_ipv4.address}}" port=8080 state=started delay=3 timeout=15
    
    - name: Test for Marathon info endpoint
      get_url: 
        url="http://{{ansible_default_ipv4.address}}:8080/v2/info" 
        dest=/tmp/marathon-info
        force=yes
      register: status
      failed_when: "'OK' not in status.msg"


Increase timeout waiting marathon to be up in test.
Increase timeout waiting marathon to be up in test.
