---
- name: add mesosphere repository
  sudo: yes
  yum:
    name:  http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm 
    state: present
  tags:
    - marathon

- name: install marathon package
  sudo: yes
  yum:
    name: marathon 
    state: present
  tags:
    - marathon

- name: enable and start marathon
  sudo: yes
  service:
    enabled: yes
    name: marathon
    state: started
  tags:
    - marathon

- name: ensure consul register.d is present
  sudo: yes
  file:
    path: /etc/consul/register.d
    state: directory
  tags:
    - marathon

- name: generate marathon consul service
  sudo: yes
  template:
    src: marathon-consul.j2
    dest: /etc/consul/register.d/marathon.json
  notify:
    - register marathon with consul
  tags:
    - marathon

---
- name: add mesosphere repository
  sudo: yes
  yum:
    name:  http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm 
    state: present
  tags:
    - marathon

- name: install marathon package
  sudo: yes
  yum:
    name: marathon-0.7.6
    state: present
  tags:
    - marathon

- name: enable and start marathon
  sudo: yes
  service:
    enabled: yes
    name: marathon
    state: started
  tags:
    - marathon

- name: ensure consul register.d is present
  sudo: yes
  file:
    path: /etc/consul/register.d
    state: directory
  tags:
    - marathon

- name: generate marathon consul service
  sudo: yes
  template:
    src: marathon-consul.j2
    dest: /etc/consul/register.d/marathon.json
  notify:
    - register marathon with consul
  tags:
    - marathon

Revert marathon to 0.7.6 due to bugs in 0.8.0.
Revert marathon to 0.7.6 due to bugs in 0.8.0.
