---
- 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

- include: conf.yml

- name: configure marathon unit file
  sudo: yes
  replace:
    dest: /usr/lib/systemd/system/marathon.service
    regexp: "=network.target"
    replace: '=mesos-master.service'
  notify:
    - reload marathon
    - restart marathon
  tags:
    - marathon

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

- name: ensure consul.d is present
  sudo: yes
  file:
    path: "{{ consul_dir }}"
    state: directory
  tags:
    - marathon

- name: generate marathon consul service
  sudo: yes
  template:
    src: marathon-consul.j2
    dest: "{{ consul_dir }}/marathon.json"
  notify:
    - reload 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
    state: present
  tags:
    - marathon

- include: conf.yml

- name: configure marathon unit file
  sudo: yes
  replace:
    dest: /usr/lib/systemd/system/marathon.service
    regexp: "=network.target"
    replace: '=mesos-master.service'
  notify:
    - reload marathon
    - restart marathon
  tags:
    - marathon

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

- name: ensure consul.d is present
  sudo: yes
  file:
    path: "{{ consul_dir }}"
    state: directory
  tags:
    - marathon

- name: generate marathon consul service
  sudo: yes
  template:
    src: marathon-consul.j2
    dest: "{{ consul_dir }}/marathon.json"
  notify:
    - reload consul
  tags:
    - marathon

Remove hardcoding of marathon 0.7.6 version
Remove hardcoding of marathon 0.7.6 version
